

MCQOPTIONS
Saved Bookmarks
This section includes 10 Mcqs, each offering curated multiple-choice questions to sharpen your Technical MCQs knowledge and support exam preparation. Choose a topic below to get started.
1. |
Access modifiers cannot be used for local variables. |
A. | Yes |
B. | No |
C. | Can be yes or no |
D. | Can not say |
E. | |
Answer» B. No | |
2. |
Which of the following is an Example of variable initialization? |
A. | int a, b, c; |
B. | int a = 10, b = 10; |
C. | int 10 = a; |
D. | None of the above |
Answer» C. int 10 = a; | |
3. |
Static variables can be accessed by calling with the? |
A. | Object name |
B. | Class name |
C. | Function name |
D. | Can not say |
Answer» C. Function name | |
4. |
Which variables have no default values? |
A. | Static Variables |
B. | Instance Variables |
C. | Local Variable |
D. | Both A and B |
Answer» D. Both A and B | |
5. |
What is true about Instance Variables in java? |
A. | Instance variables are declared in a class |
B. | When a space is allocated for an object in the heap, a slot for each instance variable value is created. |
C. | Instance variables can be declared in class level before or after use |
D. | All of the above |
Answer» E. | |
6. |
Local variables are declared in? |
A. | methods |
B. | constructors |
C. | blocks |
D. | All of the above |
Answer» E. | |
7. |
How many kinds of variables in Java? |
A. | 2 |
B. | 3 |
C. | 4 |
D. | 5 |
Answer» C. 4 | |
8. |
To declare more than one variable of the specified type, we can use a __________ list. |
A. | colon-separated |
B. | bracket-separated |
C. | comma-separated |
D. | None of the above |
Answer» D. None of the above | |
9. |
Each variable in Java has a specific type, which determines the size and layout of the variable's memory. |
A. | TRUE |
B. | FALSE |
C. | Can be true or false |
D. | Can not say |
Answer» B. FALSE | |
10. |
A ________ provides us with named storage that our programs can manipulate. |
A. | data type |
B. | constants |
C. | operators |
D. | variable |
Answer» E. | |