In this example we will show How to create a class and an object of a class in Java.
Source Code
package com.beginner.examples;
public class CreateClass { // class
int i = 12;
public static void main(String[] args) {
CreateClass c = new CreateClass(); // object
System.out.println(c.i);
}
}
Output:
12