Professional Documents
Culture Documents
Java Programming
Course Objective
To introduce Java Architecture & appreciation of the basic syntax in Java Language To illustrate how to make use of standard Java Class Library and create reusable classes.
16-06-2011
References
Java2: The Complete Reference 3rd Ed., Tata McGraw-ill Publishing Company Limited, New Delhi.
http://java.sun.com/docs/books/tutorial/
OO Basics
Abstraction
16-06-2011
Objects
PC
are things
Objects
Objects
Data Function
Data Function
16-06-2011
Class
A class defines a real world or abstract entity. A class defines both the behavior and attributes
Object
An object is an instance or variable of a class. It is said to belong to the class. An object can be distinguished from other objects by its attributes.
Introduction to Java
A general-purpose language
High-level language Developed initially for consumer devices Helps in building a dynamic Web Supported today by most of the big
16-06-2011
Features of Java
Draws An
Uses
A
16-06-2011
Platform independence...
JVM can be considered as a processor purely implemented with software. The .class file that is generated is the machine code of this processor.
The interface that the JVM has to the .class file remains the same irrespective of the underlying platform. This makes platform independence possible
16-06-2011
The
The
Java Architecture
Source File (HelloWorld.java) Class Loader
Compiler (javac)
Interpreter
Runtime
Hardware
JVM
16-06-2011
Java Installation
take care!! cAsE of file name matters. Make sure that the file is NOT saved as HelloWorldApp.java.txt [Refer Notes]
16-06-2011
To Compile
Open a command prompt Go to the directory in which you have saved your program. Type javac HelloWorldApp.java
If it says bad command or file name then set the path If it does not say anything, and you get the prompt, then the compilation was successful.
To execute
Type
The
result
java HelloWorldApp
16-06-2011
Interpreter (java)
Interpreter (java)
Interpreter (java)
Win 32
Linux
Mac
Summary
of a Java Program
a Java Program a Java Program
10