Author: Amit Jain
What is the use of Abstract modifier in Java An abstract is a modifier applicable to classes and methods but not for variables. Abstract Method Even though we don’t know about implementation still, we can declare a method with abstract modifier i.e. for the abstract method the only declaration . . . Read more
What is final in Java? Final is the modifiers applicable for classes, methods, and variables. The main advantage of final keyword is we can achieve security and we can provide the unique implementation. Final keyword improves performance. Not just JVM can cache final variable but also application can cache frequently use final . . . Read more
What is Modifier and what are the applicable Class Modifiers? Modifiers are keywords that you add to class, methods, and variables to change their meanings. Java language has a wide variety of modifiers. Access modifiers are a specific part of programming language syntax used to facilitate the encapsulation of components. . . . Read more
What is package and what is the advantage? It is an encapsulation mechanism to group related classes and interface into a single unit, which is nothing but packages. Packages are named in reverse order of domain names, i.e., com.java4us.packageprogram.A Java package is a group of similar types of classes, interfaces, and sub-packages. . . . Read more
Difference between normal import & static import? Explain import statement and difference between normal import & static import? To access a class or method from another package we need to use the fully qualified name or we can use import statements. The class or method should also be accessible. Accessibility . . . Read more
How many class can be public in Java Program? A JAVA Program can have any number no class but at most one class can be declared as public. If there is public class then the name of the Java program must be same as public class otherwise we will . . . Read more