C# Test

Réussis tes devoirs et examens dès maintenant avec Quizwiz!

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

While()

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?

+

How do you insert COMMENTS in C# code?

//

Array indexes start with :

0

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

Is C# an alias of C++?

False

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"};

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

Int x =5;

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

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

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()


Ensembles d'études connexes

What makes people happy at work?

View Set

UNIT 2 Exam- Chapters 6-9 Review

View Set

Accounting 210 Chapter 6 LearnSmarts

View Set

SIE Simulated Exam 2 (Solutions and answers)

View Set