React.js
Angular
Ethical Hacking
Agile
AWS
BlockChain
Cassandra
Cloud
Salesforce
Scaled Agile
TOGAF
DevOps
GIT
Jenkins
Jira
Kibana
Linux
NGINX
Ansible
Artificial Intelligence
in JAVA by

What is a Class?

All Java codes are defined in a class. A Class has variables and methods.

Variables are attributes which define the state of a class.

Methods are the place where the exact business logic has to be done. It contains a set of statements (or) instructions to satisfy the particular requirement.

Example:

view sourceprint?

1

public class Addition{ //Class name declaration

2

int a = 5; //Variable declaration

3

int b= 5;

4

public void add(){ //Method declaration

5

int c = a+b;

6

}

7

}

Click here to read more about DevOps

Related questions

Madanswer
0 votes
asked May 24, 2019 in JAVA by rajeshsharma
0 votes
asked May 24, 2019 in JAVA by rajeshsharma
...