Professional Documents
Culture Documents
Q15. Define A Java Class.: YES YES YES YES YES NO YES YES YES NO YES YES NO NO YES YES NO NO NO YES
Q15. Define A Java Class.: YES YES YES YES YES NO YES YES YES NO YES YES NO NO YES YES NO NO NO YES
Q15. Define A Java Class.: YES YES YES YES YES NO YES YES YES NO YES YES NO NO YES YES NO NO NO YES
A class in Java is a blueprint which includes all your data. A class contains fields
(variables) and methods to describe the behavior of an object. Let’s have a look at
the syntax of a class.
1 class Abc {
3 methods}
An object is a real-world entity that has a state and behavior. An object has three
characteristics:
1. State
2. Behavior
3. Identity
Example
1 if(x > 100)
2 {
4 }
1 class Test{
4 }
Methods Constructors
5. Method name may or may not be 5. Constructor name must always be the same as
same as class name the class name