C# Test

Pataasin ang iyong marka sa homework at exams ngayon gamit ang Quizwiz!

How do you start writing a while loop in C#?

While()

How do you insert COMMENTS in C# code?

//

Array indexes start with :

0

Is C# an alias of C++?

False

How do you create a variable with the numeric value 5?

Int x =5;

Which keyword is used to return a value inside a method?

Return

What datatype is used to create a variable that should store text?

String

In C# is it possible o inherit fields and methods from one class to another?

Yes

Which operator is used to multiply numbers?

*

Which operator is used to add together two values?

+

Which operator can be used to compare two values?

==

Which statement is used to stop a loop?

Break;

Which keyword is used to create a class in C#?

Class

What is a correct syntax to output "Hello World" in C#?

Console.WriteLine("Hello World");

How do you create a variable with the floating number 2.8? (this is a difficult question, as float is not an option, double is the onl)

Double x= 2.8D;

What is the name of the 'special' class that represents a group of constants?

Enum

How do you write an if statement in C#?

If (blah > meh) { whatever happens }

Which property can be used to find the length of a string?

Int bob= StringName.Length();

To declare an array in C#, define the variable type with:

Int bob[] = {"stuff","things"};

What is the corrert way to create an object called myObj of My class?

Name of file name of new = new file name ();

Can the value of a string variable be surrounded by single quotes?

No

Which access modifier makes the code only accesible within the Same class?

Private

Is type casting when you assign a value of one data type to another type?

True

How do you create a method in C#?

Void Curt () { }

How do you calla method in C#?

nameofmethod()


Kaugnay na mga set ng pag-aaral

What makes people happy at work?

View Set

Chapter 5 " Anxiety, Obsessive-Compulsive, and Related Disorders"

View Set

UNIT 2 Exam- Chapters 6-9 Review

View Set