Creating a JAVA class

  • Every Java code is defined in classes.
  • Classes are defined in the source code file with extension .java.
  • JAVAC command is used to compile your JAVA code, and it also creates a file with extensions .class, which is interpreted by JVM,
  • then JAVA command is used to run the compiled byte code file.
  • but there must be at most one public class file if there is a public file that must be similar to the file name else if no public class exists file name can by be any...
  • .class files are created for every class in JAVA.
Main1.java