110 likes | 361 Views
Java means Coffee Java Coffee Beans. The name “JAVA” was taken from a cup of coffee. Introduction to JAVA. High Level Programming Language (HLL) Java , released in 1995, is a relatively new programming language.
E N D
Java means Coffee Java Coffee Beans The name “JAVA” was taken from a cup of coffee
Introduction to JAVA • High Level Programming Language (HLL) • Java, released in 1995, is a relatively new programming language. • Developed by James Gosling from Sun Microsystems and his team
Creating a Java Program .java javac .class java
Java Program: a set of instructions for the computer to follow. The source code. Saved as filename.java • Data: data for the Java program • Java Compiler (javac):translates the program from Java to a language that the computer can understand. • Byte Code Program: the compiler translates Java into a language called byte-code. Byte code is the machine language for Java Virtual Machine (JVM). filename.class • Byte Code Interpreter (java):the interpreter (JVM) translates byte code into machine language (.exe) • Machine Language: is the language the computer understands.
Parts of a Java Program This is same as header file in C. This package is used for input and output.
Parts of a Java Program Every Java program is a class. The program starts with the name of the class. The class name must be the same as the . java file you save.
Parts of a Java Program A main method is needed for execution to start. This main method gets executed first. The array of strings parameter is must.
Parts of a Java Program Output statements: the basic output statement in Java is the System.out.println( ) or System.out.print( )
Constant Variables • Constant is a variable whose value does not change in the program. Eg: PI = 3.14 The keyword ‘final’ is used to define constant in Java Eg. final intcount = 100; final double PI=3.14;