We will describe in this tutorial about The class keyword in Java programming language
In Java programming language, the class is a keyword in Java which is used to declare a new class which is a collection of related variables and methods
the class is a very important concept and basic building block of java
Syntax
the syntax of the declaration of a class given below
[access-modifiers] class [identifier] { [class body] }
Example
class Class_Name { //properties or data members //methods or constructor }
Example for usage of the class keyword
we can use create a class using the class keyword
public class human{ int age; //variable or data type as integer String name; //variable or data type as String void walking(){ //method 1 } void driving(){ //method 2 } }
Program 1
public class human{ int age; //variable or data type as integer String name; //variable or data type as String void walking(){ //method 1 } void driving(){ //method 2 } human(){ //constructor } }
There are other Java language keywords that are similar to this keyword
Usage of this statement in the Java language
How to find reverse number using method In this article, we will discuss the concept…
C# inverted full pyramid star pattern In this article, we will discuss the concept of…
C# Full Pyramid star pattern program In this article, we will discuss the concept of…
Program to count vowels, consonants, words, characters and space in Java In this article, we…
How to print multiplication table using Array in C++ language In this post, we will…
C Program to multiplication table using Array In this tutorial , we will discuss about…