Chapter 1
Chapter 1
Introduction
Key Objectives
Class Account{
int account_number;
int account_balance;
public void showdata(){
system.out.println(“Account Number”+account_number);
system.outprintln(“Account Balance”+ account_balance);
}
}
showData();
Object-Oriented Programming
Source: http://statisticstimes.com/tech/top-computer-languages.php
Features of java
• Sytem.out.println("Hello! World");
– System is a built-in class present in java.lang package.
– This class has a final modifier, which means that, it
cannot be inherited by other classes.
– It contains pre-defined methods and fields, which
provides facilities like standard input, output, etc.
– out is a static final field (ie, variable) in System class
which is of the type PrintStream (a built-in class,
contains methods to print the different data values).
– static fields and methods must be accessed by using the
class name, so ( System.out ).
Skeleton of Java program
class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello World!");
}
}
20
Compiling and Running Your First Program
21
Creating, Compiling, and Running Programs
22
Types of Java Program
23
Types of Java Program…
24
Types of Java Program…
Advantages of Applets :
• Execution of applets is easy in a Web browser and does
not require any installation or deployment procedure in
real time programming (where as servlets require).
• Writing and displaying (just opening in a browser)
graphics and animations is easier than applications.
• In GUI development, constructor, size of frame,
window closing code etc. are not required (but are
required in applications).
25
Types of Java Program…
26