When declaring a variable in a class , what # the project?
A -
The public keyword declares a variable that is avilable to #
B -
The inherits keyword declares avaiable that is available to
C -
The protected keyword declares avaiable that is available to
D -
The private keyword declares avaiable that is available to
2-
What output does the code below generate then compiled/run?
1. class Employee{
2. public int EmployeeId;
3. public static Employee getEmpId(int EmpId){
4. Empoyee emp=new Employee( );
5. emp.EmployeeId=EmpId;
6. return(emp);
7. }
8. }
9. class Test{
10. public static void Main(){
11. Employee[] emps=new Empoyee[2];
12. emps[0] = Employee -getEmpId(1);
13. emps[0] = Employee -getEmpId(12);
14. foreach(Employee e in emps)
15. System.Console.WriteLine(e.EmployeeId);
16. }
A -
The code will generate a compile tiem error at line 12 and line13
B -
The code will generate a null exeception, as the employees are not initialized
C -
The code will compile seccessfully and output will be; 0 1
D -
The code will compile seccessfully and outputs will be; 1 2
3-
When should you choose a ComboBox control #
A -
When you want to wnter text in the control
B -
When you want to select multiple items in the control
C -
None of the above
D -
When you want to select only a single item in the control
4-
When you try to set a particular font style, say italics
btn.Font.Italic = true;
you get an error message "Property cannot be assigned to – it is read only". How can I set this
read only property?
A -
btn.Font = new Font(FontStyle.Italic):
B -
bitn.Font = new FontStyle.Itaclic():
C -
Use the Format peoperty of the TextBox yo "#C"
D -
Use the CharacterCasing property og the TextBox to CharacterCasing.Upper .
5-
What will be the output of the code below when compiled/run?
1. class Test {
2. public static void Print(object[] arr){
3. foreach(object p in arr)
4. System.Console.WriteLine(p);
5 }
6. public static void Main(){
7. string s= "Programming in c#";
8. char[] separator=( );
9. string[] words = s.Split(separator);
10. Print(words);
11. }
12. }
A -
None of the above
B -
The code will generate an error at compile time at line 9 as the function Split used is not supperted string data type
C -
The code will generate an error at line 10 as conversion not allowed for onw array type to another array type
D -
The code will compile seccessfully and output will be: Programming In c#
6-
When working with strings ____.
A -
Any other letter is considered a character
B -
Any literal within quotation marks
C -
A space is considered a character
D -
All of the other answers
7-
Which of the following property of method #
A -
SelectedIndex
B -
Select()
C -
SelectedItem
D -
SelectedValue
8-
Which of the following best describes Garbage Collector.
A -
Garbage Collector destroys the pointers
B -
Garbage Collector is responsible for automatic memory management
C -
Garbage Collector copies the IL code to the heap
D -
Garbage Collector get more memory for the application when the application need.
9-
Which of the fowllowing are possible value #
A -
Checked, Unchecked, Indeterminate
B -
True, False
C -
Checked, Unchecked
D -
Checked, Notchecked
10-
Which is statement is correct?
A -
The MonthCalendar control allows you to select a date and time, and the DateTimePicker control allows you to select a date or range of dates.
B -
The DateTimePicker control allows you to select a date and time, and the MontCalendar control allows you to select a date or range of dates.
C -
The DateTimePicker control and the MonthCalendar control allows the user to select the date and tine in different formats