Java Program First Line.

public class abc {......}

This line indicates that we are creating a new java class named abc. After we translate this class into bytes codes, the java virtual machine will be able to create objects of this class and run them. this code is just to get us started with java programming.

Note that keyword public in the preceding code. This keyword an access specifier. The public access specifier indicates that this class is available anywhere in a program that makes use of it.

Note also that if you make a class public, java insists that you name the file after it. That is, you can only have one public class in a .java file. The reason for this is that the java compiler will translate the .java file into a bytecode file with the extension “.class”, which means that app.java will be translated into app.class, and if the JVM needs the app class.


public class abc {........}

Java always encloses blocks of code within curly braces-that is, “{” and “}”. the code inside the block has its own scope. right now, however, let`s continue building our application by continuing on to the next line of code.