Java – Static – MCQ
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
Selvam College of Technology (Autonomous)
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
Polymorphism in OOP allows a single interface to handle multiple data types, improving code flexibility and reusability. It has two types: compile-time polymorphism (method overloading)
Inheritance allows a new class to inherit the properties and behaviors (fields and methods) of an existing class, promoting code reuse and creating a hierarchical
Encapsulation in Java is the concept of bundling data (variables) and methods that operate on the data into a single unit, restricting direct access to
In Java, a constructor is a special method used to initialize objects. It has the same name as the class and runs automatically when an
In Java, methods are reusable blocks of code defined with a name, parameters, and a return type. They can be instance methods, static methods, or