First project - C#
Hello!
Welcome on almost last blog about basics! We need to understand what is root problem of programming, we need to know how to write a program and then how to make it to looks good. During your programming life you can grow in knowledge how to have good practice and learn it, because it is important. On this blog I will make nice algorithms and make it great, but for those people who's never start to make it happen I decided to make start articles like this.
Application.cs
using System;
using System.Collection.Generic;
using System.Linq;
using System.Text;
namespace FirstApplication {
class OurObject {
private string firstTextPart;
OurObject(string text) { firstTextPart = text; }
public static string FirstFunction() {
return “I am “+firstTextPart+” almost”;
}
}
class Application
{
static void Main(string[] args) {
OurObject ourObj = new OurObject(”junior developer”); Console.BackgroundColor = ConsoleColor.Red;
Console.WriteLine( ourObj.FirstFunction() ); }
}
}
The most important think! You need to change this scripts, use it in different way? Look how the name parameter work. Make something different from this code. Use it to learn how it works.
So we have start point - main function. So we made an object using constructor with parameters. Next we are using function from Base class and function will write on console, so try it!