answersLogoWhite

0


Best Answer

Because you are creating a class - a class in the sense of OOP.

User Avatar

Wiki User

11y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Why is a keyword class used before a java program?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What is a new keyword in java methods?

new is a keyword to create a instance of object any class.


Is sizeof keyword in Java?

sizeof is not a keyword in Java but many classes have size() or length() methods, which can mean the number of elements, characters, etc. depending on the class.


The Java keyword is used to declare a class as a subclass of another class?

class MyClass extends AnotherClass {}


What is the program to use the super and final keyword in java?

Many programs use those keywords.super refers to the direct superclass of the class referencing itfinal declares a variable or class unchangable


Why you start java program by class?

without class non of the folder can run so the java program should start in class we can use the class without object in java


Can you make a class final in java?

yes of course... using the final keyword


Is check a keyword in java?

No, 'check' is not a keyword in java language.


What will happen if a Java Class has no Main Method?

Nothing will happen. There is no restriction that every Java class must have a main method. The only program is that, this class cannot be executed as a standalone java program.


Is float is a keyword in java?

yes, float is keyword and data type in java


Difference between super and this in java?

The keyword super is used to explicitly call methods/values from the parent class The keyword this is used to explicitly call methods/values from the current class


What is the function of this in java?

this in java is a keyword that refers to the current object of the class. It is also used in constructor overloading when you want to invoke one constructor from another within the same class.


Is super keyword is anologous to this keyword in java?

No. The keyword super is used to refer to the parent class instance while the keyword this is used to refer to the current class instance. You need to learn about Inheritance and Object creation using constructors to learn more about these keywords and their use