Question 1 of 25
Hints left: 3
Q1
In Java, which access modifier allows a method or variable to be accessed within the same package only?
Q2
Which of the following is not an access modifier in Java?
Q3
What keyword is used to declare a constant in Java, which is implicitly final and static?
Q4
In Java, what is the purpose of the static keyword when applied to a variable?
Q5
Which keyword is used to explicitly specify that a method cannot be overridden in a subclass?
Q6
Which access modifier allows a class member to be accessed within the same package and its subclasses?
Q7
Which of the following access modifiers restricts a method or variable's access to the same package only?
Q8
What is the access level of a class member with no access modifier specified in Java?
Q9
What access modifier allows a class member to be accessed from any class in the same package or any subclass?
Q10
What is the limitation of toString() method of BigDecimal?
Q11
What will be the output of the following Java code snippet? enum Enums { A, B, C; private Enums() { System.out.println(10); } } public class MainClass { public static void main(String[] args) { Enum en = Enums.B; } }
Q12
What keyword is used to declare a method that is implemented in a subclass to provide a specific implementation?
Q13
Which of the following access modifiers allows access to a class member from any class in any package?
Q14
In Java, what is the purpose of the final keyword when applied to a method?
Q15
What keyword is used to declare a method that can be called without creating an instance of the class?
Q16
Which access modifier restricts a class member's visibility only to the same class and its subclasses?
Q17
What is the access level of a class member declared as private in Java?
Q18
What is the default access modifier for a class in Java if no access modifier is specified?
Q19
What is the keyword used to declare a class that cannot be instantiated and can only be extended?
Q20
In Java, which access modifier allows a class member to be accessed from anywhere in the code?
Q21
In Java, what access modifier is used to specify that a class member can be accessed only within its class?
Q22
In Java, which access modifier allows a class member to be accessed from any class, even outside the package?
Q23
Which keyword is used to define a superclass's method that is overridden by a subclass method?
Q24
What is the default access modifier for class members in Java if no access modifier is specified?
Q25
Which access modifier allows a class member to be accessed only within its own class and package?