Generally, java class format seems below :
import package;
class classsname{
- method1();
method2();
-
-
method-n;
more specific seems below :
import package;
class name{
objects declaration;
- constructor(){
- object setting; }
- call class(); }
methode main(){
here is the sample :
import javax.swing.*;
class sample extends JFrame{
- sample(){
- super("Sample");
- show();
- setSize(200,100);
- setLocation(100,100);
- setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
} - public static void main(String[] args){
- new sample();
}