Object Oriented Programming - Methods

Which one of the following statements is true?
Every C# program is structured in the same way
Every C# program is structured in different way
Every C# program is structured in the same way. It uses: (In-order)
Methods -> Classes -> Namesapce
Namespace -> Classes -> Methods
Picture1
Where is a method? What is the name?
Namespace MyFirstProgram
Class Program
Static void Main(string[] args)
Console.WriteLine("hello World"); Console.ReadLine();
A block of code that is doing something
Attribute
Method
Method starts with which opening/closing brace?
()
{}
______ are inside methods
Instructions
Fields
The execution (running) of a program starts with the ______ method
Alternate
Main
Which one of the following statements is true?
Attributes can be used to break a complex program into small, manageable pieces.
Methods can be used to break a complex program into small, manageable pieces.
Breaking down a program to smaller units of code, such as methods, is known as ______
Encapsulation
Modularization
______ method simply executes a group of statements and then terminates
Void
Value-returning
______ method returns a value to the statement that called it
Void
Value-returning
______ does not return any value to the statement that called it
Void
Value-returning
The method ______ appears at the beginning of a method definition to indicate access mode, return type, and method name
Header
Body
The method ______ is a collection of statements that are performed when the method is executed
Header
Body
Method declaration is also known as ______
Method header
Method body
Static void Main(string[] args) - Void is a ______
Return type
Name
Static void Main(string[] args) - Main is a ______
Return type
Name
When declaring a method, always have a pair of ______ after the name
Parenthesis ()
Brackets {}
Which one of the following statements is true?
Parameters inside the parenthesis cannot change the way a method is executed
Parameters inside the parenthesis can change the way a method is executed
______ can be used (called, invoked)
Attributes
Methods
Which one of the following statements is true
Methods are inside classes
Methods are outside classes
Console.WriteLine("Hello World"); - Console is ______
Class
Method
Argument
None of the above
Console.WriteLine("Hello World"); - WriteLine() is ______
Class
Method
Arguement
None of the above
Console.WriteLine("Hello World"); - "Hello World" is ______
Class
Method
Arguement
None of the above
Console.ReadLine(); - Console is ______
Class
Method
Arguement
None of the above
Console.ReadLine(); - ReadLine() is ______
Class
Method
Arguement
None of the above
Which one is argument in Console.ReadLine(); ?
Console
ReadLine
Console.ReadLine
No argument
Console.ReadLine - The dot between Console and Readline is ______
Dot notation
UML notation
Argument is also known as ______
Virtual parameter
Actual parameter
Argument is also known as ______
Input parameter
Output parameter
Which one of the following statement is true?
Method identifiers should begin with a number
Method identifiers should begin with a letter
Which one of the following statement is true?
Method identifiers can contain letters, digits, underscore, @-sign
Method identifiers can contain letters, digits, underscore, but no @-sign
Which one of the following statement is true?
Method identifiers shouldn't use Camel Casing
Method identifiers should use Camel Casing
Camel Casing is ______
First letter of word is upper case
First letter of word is lowercase
Which one of the following statement is true?
Method identifiers can contain space
Method identifiers cannot contain space
Which one of the following statement is true?
Method identifiers cannot be a C# reserved keyword
Method identifiers can be a C# reserved keyword
Can a class have many methods?
Yes
No
Private static string WriteSomething() - private is a ______
Access modifier
Return type
Name
Parameter
______ define where a method can be accessed (invoked, called)
Access modifier
Return type
Name
Parameter
Private static string WriteSomething() - string is a ______
Access modifier
Return type
Name
Parameter
Private static string WriteSomething() - WriteSomething() is a ______
Access modifier
Return type
Name
Parameter
Private static string WriteSomething() - Does it contain parameter?
Yes
No
String myString = WriteSomething(); - WriteSomething() is ______
Method call
Method declaration
String myString = WriteSomething();
WriteSomething() has no parameters
WriteSomething() has no arguments
Executes the method
Method call
Method declaration
Private static string WriteSomething(string name) - WriteSomething is a ______
Name
Return type
Access modifier
Parameter
Private static string WriteSomething(string name) - string is a ______
Name
Return type
Access modifier
Parameter
Private static string WriteSomething(string name) - private is a ______
Name
Return type
Access modifier
Parameter
Private static string WriteSomething(string name) - (string name) is a ______
Name
Return type
Access modifier
Parameter
String myString = WriteSomething("Elke"); - WriteSomething is ______
Method call
Argument
String myString = WriteSomething("Elke"); - "Elke" is ______
Method call
Argument
Call same method name with different arguments
Method overload
Buffer overflow
Method header with same name but different parameters
Method overload
Buffer overflow
{"name":"Object Oriented Programming - Methods", "url":"https://www.quiz-maker.com/QPREVIEW","txt":"Which one of the following statements is true?, Every C# program is structured in the same way. It uses: (In-order), Where is a method? What is the name?","img":"https://www.quiz-maker.com/3012/images/ogquiz.png"}
Powered by: Quiz Maker