
I am a beginner in programming and tried to learn how to do programming in Java. Friends please explain how can I create a class in Java.

hi friend, As you said that you are a learner of Java programming and want to create a class in Java so, lets understand first what is class in Java.
Class in Java is a blueprint that facilitate you to declare data members and methods as well as to define methods.
Here sample code is being given which demonstrates how to create a class in Java.
public class JavaSampleClass
{
int i = 5;
String str = "How to create a class in Java";
public void intDisplay()
{
System.out.println(i);
}
public void strDisplay()
{
System.out.println(str);
}
}
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.