Java – Enum – MCQ
Enum is a special data type that defines a set of constants, providing type safety and allowing for more readable code, especially when dealing with
Selvam College of Technology (Autonomous)
Enum is a special data type that defines a set of constants, providing type safety and allowing for more readable code, especially when dealing with
In Java, access modifiers define the visibility of classes, methods, and variables. They include public, protected, private, and the default (package-private) modifier.
Scope in Java refers to the region of the program where a variable, method, or class is accessible. It determines the visibility and lifetime of
In Java, packages are used to group related classes and interfaces, providing a modular structure to organize code and avoid naming conflicts. A package can
In Java, the final keyword is used to define constants, prevent method overriding, and prevent inheritance. When applied to a variable, it makes the value
The static keyword, on the other hand, is used to declare members (variables or methods) that belong to the class rather than any particular object
In Java, the super keyword is used to refer to the parent class’s members (variables, methods, constructors). It is typically used to call a superclass’s
In Java, this is a reference variable that refers to the current object of the class. It is used to differentiate between instance variables and
In Java, an interface is a blueprint that defines abstract methods, which implementing classes must provide. From Java 8, interfaces can also have default and
in Java is a concept that allows hiding the implementation details and exposing only the essential features of an object. It is achieved through abstract