Tag: Keywords in java

What is Volatile keyword in Java? Volatile is the modifier applies only to variables and we can’t apply anywhere else. If the value of a variable keeps on changing by multiple threads then there may be a chance of data inconsistency problem. We can solve this problem by using the . . . Read more

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

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