Unity Developer Question: Download Questions PDF
Tell me the basic construction of a C# program. Write a simple program that outputs “Hello World” to the console?
Answer:
A typical C# program consists of a namespace declaration, a class, methods, attributes, a main method, statements, expressions, and comments. A potential example for printing “Hello World” to the console is detailed below.
using System;
namespace HelloWorldApplication
{
class HelloWorld
{
static void Main(string[] args)
{
Console.WriteLine("Hello World");
Console.ReadKey();
}
}
}
using System;
namespace HelloWorldApplication
{
class HelloWorld
{
static void Main(string[] args)
{
Console.WriteLine("Hello World");
Console.ReadKey();
}
}
}
Download Unity Developer Interview Questions And Answers
PDF
Previous Question | Next Question |
Please tell us what are your lifelong dreams? | Explain me how does C# handle encapsulation? |