Java MCQ's on Java
This test contains 10 questions based on Java.
Each question answered correctly awards you 1 point and each incorrect answer has a penalty of -0.25 points, no points are deducted for unattempted answers.
Select Test Type
You Get +1 for each correct answer and -0.25 for each incorrect answer
Time Left -
minutes
:
seconds
Weakest access specifier among the following is
| public | private |
| default | protected |
Which access specifier should be used with a class which should be available everywhere in the project.
| public | private |
| default | protected |
Which of the following access specifier cannot be used with a class.
| default | private |
| protected | Both B and C |
Can we write two public classes within the same class.
| Yes | No |
Which access specifier allows methods of a class in package A to be used by a class in package B.
| public | protected |
| default | Both A and B |
Which access specifier is used for hiding data of classes of a package from classes of another package.
| protected | private |
| default | protected |
Which access specifier should be used with a constructor so that this class cannot be inherited.
| public | private |
| default | protected |
How many non public classes can be declared within the same file.
| Only 1 | 1 or more |
| only 2 | Any number of classes. |
Which access specifier allows access to the class members that inherits this class.
| public | private |
| default | protected |
Which access specifier are used for methods of an interface.
| public | private |
| default | Any of the above |
Finish Test
No comments: