0% found this document useful (1 vote)
37 views8 pages

Introduction to Java Programming

This is a pdf about simple java in sinhala Anad this belongs to all saints college galle this is a file produced for there it day
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (1 vote)
37 views8 pages

Introduction to Java Programming

This is a pdf about simple java in sinhala Anad this belongs to all saints college galle this is a file produced for there it day
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

An Introduction to JAVA

1991
Sun Microsystems

(Platform Independent)
%,
, .
, 2009 1
;

([Link])

HTML (JAVA Applets)


HTML

NASA

(JAVA program
codes)

JAVA Editions

J2SE - Java 2, Standard Edition


(GUI Applications)
(Connecting Databases) (Using Computer
Networks) (Controlling Input & Output Devices)
(Computer Security Applications)
J2EE - Java 2, Enterprise Edition

(Java Server Pages JSP, Extensible Markup Language- XML, JAVA Database
Connectivity-JDBC, JAVA Web Service, JAVA Mail, Enterprise JAVA Beans)
J2ME - Java 2, Micro Edition
PDA
(J2ME)

The Functionality of JAVA


JDK (Java Development Kit)
JDK
[Link] Java Virtual Machine
2. Java API Java Application Programming Interface

Notepad(.java) (Save)
Text
Editor
JCreator,
JBuilder,
NetBeans
(Java Editors)

(Save).java
(Human
Readable Code)

(Compile)

Java Compiler .class

(Byte Code)
JVMJVM
.class
.class
JDKJRE(JavaRuntime Environment)

JREJDK
JRE
JDK
JRE

JDK - Downloading Java Development Kit

JDK
[Link] DownloadJavaSE
Java SE Development Kit (JDK) JDK 6 Update 14
DownloadPlatform JDK
I Agree
Continue
Available Files .exe Download

JDK - Installing JDK

jdk setup JDK1,2,3,4

My Computer C:\ Program Files Java


jdk

bin
C:\Program Files\Java\jdk1.6.0_05\bin
Address bar path
My Computer Properties
Advanced Environment Variables 5

Environment Variables
System Variables Path Edit
6
Edit System Variable Variable
value
7
(semi-colon)(;) copy paste
7OK OK
Start All Programs Accessories Command Prompt Start Run cmd
Command Prompt
java javac Enter java help .....
is not recognized as an internal or external command,operable program or batch file.

Fundamentals of JAVA
Object- Oriented Programming Language(OOP)
Methods
Variables (Objects)
Class
Case Sensitive Language
Example example
classes Main class

Main class public static void main(String args[])


JVM

Main class

Notepad
save Save as
type All Files
File name
class name
.java [Link] Class name

$ _

Java Keywords
Java Keywords

[Link](This is a sample text); statement


This is a sample text
Notepad
[Link] C:
Command Prompt cd\ enter C:\ C:\>
Command Prompt javac [Link]
[Link] [Link]
java MyProgram
This
is
a
sample
text

CommandPrompt
[Link]

Java Primitives (Data Types)


Data Types
byte, short, int, long, float, double, char, boolean byte
byte short int
(Integer Numbers)long
int float double
char (Character)
ASCII Value boolean true false

Java Operators

Variable name

Variable type
Value

Data Types Data Type


class
name
statement ;

[Link](); Variables
JCreator Build Compile File Build
Execute Project

Java Operators
1. Arithmetic Operators

Arithmetic Operators
+

*
/

addition
subtraction
multiplication
division

xintvariable
xyint variable Arithmetic Operator
%
int x= 10%3 ; x
++ -- += -= Arithmetic Operators
int x = 5 ;x++;
x x++
x-- int x = 5 ;x+=20; x
x+=20 x-=20

2. Relational Operators
Relational Operators
true false
>
>=
<
<=

greater than
greater than or equal to
less than
less than or equal to

b 10 15
b

3. "Equality" Operators

= = equals ("equal to")

!=
not equals ("not equal to")
x 10
y 15
b

4. Logical Operators

&
AND
-
|
OR
-
x 10 y 5 x
15 y 10 b
b

x 10 y 5
x 15 y 10 b
b

x 10 y 5 x 15
y 10 b
b

You might also like