Answers for "define a class in java"

0

classes in java

public class Main {
  int x = 5;

  public static void main(String[] args) {
    Main myObj = new Main();
    System.out.println(myObj.x);
  }
}
Posted by: Guest on September-25-2021
0

how to make a class in java

public class Main {
 public static void main (String[] args) {
	System.out.println("Hello World");
 } 
}
Posted by: Guest on November-19-2019

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language