0% found this document useful (0 votes)
7 views120 pages

Java

The document provides a comprehensive overview of Java programming, including its history, features, and applications. It covers key concepts such as object-oriented programming, data types, type casting, and the Java development environment. Additionally, it outlines the compilation process and includes examples of Java code and its execution.

Uploaded by

Lokesh Nitharwal
Copyright
© All Rights Reserved
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 (0 votes)
7 views120 pages

Java

The document provides a comprehensive overview of Java programming, including its history, features, and applications. It covers key concepts such as object-oriented programming, data types, type casting, and the Java development environment. Additionally, it outlines the compilation process and includes examples of Java code and its execution.

Uploaded by

Lokesh Nitharwal
Copyright
© All Rights Reserved
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

COMPUTECH ACADEMY

BY - SUNIL YADAV SIR 9694473047, 8875473047

Hand Written Notes

Java

ADDRESS : 8-A SHREE GOPAL NAGAR , NEAR MAHESH NAGAR POLICE STATION ,BEHIND ZUDIO , GOPALPURA BYPASS ROAD , JAIPUR
Java

e5 programming tangunge &


Java
→Java tHigh levet-tanguoge,object oviented language; bbust
Rob pregramming
langunge &
→ Java को sun micsiosystem (0oacle)के घारा अधिग्रहण) ने ५995 में
James Glosing (father of Java)के द्वारा Devely मी गई।
Java का पहले नाम ock था।

first version JDk 1.0 23 Jan 1996


latest Version Java SE23 17 sept 2024

features of Java (Java buzz words)


④ simplel-

→Easy to learn
→ Java & syntex simple aar

@ Object oriented
Oclass

object
Inheritance
polymorphism.
Abstraction
@ Encapsulation

Java program (clas)


@platform Independent:-
→ write. once Run Anywhere
(WORA) mae ols windowsols tinux 0/5
JVm JVm Jvm
7
④ Portable
byte code(Class)को किसी भी platform पर हो जाया
सकता है।

5
Robust!-

→ProvidleGarbage Collector
→Ex ception Hanaling mechoonism

⑥ support multithreading:-
-Java program multiithreading ost support as

@Architechrral Neutral:- Javast Dada type atsize fixed at

Secure!-
Secure

c++ Run
Java
10/5 Vueboed Jvm
iprogsam
ols
OS

Rundime Environment •Runtime Environment


opertting system (Java virtual machime)
Application of Java:-
①Deskitop Application (Adabe Reader)
② web Application ([Link])
② mobile Application
④ Enterprise Application (Bonking Appliaution)
③ Embedded system

Installatiom:-
① Download JDK (Java Development kit)
② Code Editor /IDE
Note pad
Visual studio
③ Intillij
Eclipse
netbeams

* first Java program


3 Class Hello world

public static void main (string[I args)


ε

[Link] prnt In ("Hello World");


3

3 H-
Compile
Javae Hello world. Java
Execute
Java Hello World
sutput
Hello World
* Valid:-

6 Public static Void main (string [] aags)


⑥ Public static void maim( storing [args)
(
3 Public Static Void main (st (string args []
4
Public Static Void main (sts (string-----args)
⑥ Stadic Public void mam((string EI args)

Class Hello world Class Name


y Point
·

NoValwe r Java Ento


ε etuo
argument
43
main (string []
public static vaid ma m( cags
Accessmodifier Not riguired ofject create
[Link]. printnC"Hell");
3 .ClassName
print Console screen
3H object method
Name Name

optional

*Invalid-
O Public void maim (string rI args

② Static void mam (string CI args)


③ Publio void stadic main (string [I cags)
*Identifiear:-
[A-Z], [a-37, (0-9) under score, $ (Doller)
D
Digit से जवननही हो सकता है।
Okayood का useनही कर सकते हैं।
(pre-defined words)
Java case senstive होता है।

Keyword
・abstract Continue for new Swicth
assert*** defautt g0to* packoge synchronlzed
boolean do if Private this
break double implement Protected throw
else import public throws
byte
Case enumxxx* instanceof return. transient
Short
Catch extends int try
Char findl interface Static Void
Class float Long Strictfp** Volatile
native supur While
Const
Finally
* not wsed
*x added in 1.2

*** added in 1.4

**** added in 5.0

Variabte
a
Variable- Data
50

4096

RAM
② Non-primitive Data type:-
Type casting एक Data type को दूसरे Data typeमें convert करना।
Types of type Casting:-
Implicit type casting lwidening type Casting /Automadic type casting!
→ Data 108 नहींहोगा छोटे से बड़े की और

byte short char-sint- long float double

@ Explicit type Casting /Narrowing type casting:-


→ इसमें Data 108 होता है।

- double float long int Char Shortbyte

Note-
boolen Data type की Type casting नही की जातीहै।
Error Type Incompatible
0301/2025
Programming fundamental
10,5 Cemputer Set of program
① int a=20; (प्रोग्राम का समूह)
int b=5; Hardwsere Software

int c= atb;
set of instruetion
④ [Link] printtri(c);
•Hardware Translator [int a=10;
instruction int b =20,

Software int c=atь,

,0, 1 format [Link] pont/n(c);


,machine code Compiler Interpreter
High-level Code
High levet ponguage program 5T
Target codea convert करता है।

10,5
R R2
LOAD R1

10111011011 machine ADD R2 Assembly langusge


Code Send
•operation
Addition ADD

② machine language multiplication MUL


Division DIV
③ Assembly lang uage
LOAD
@ High-level longuage
STORE

machine Code
Assembly longuege

① LOAD R1 1011 01001 1101

ADD Ra
Note-
Assembly language में लिखा गया code Translator, Assembler
के द्वारा कोrectly machime code में convert कर दिया जाता है।

Hi
xtilgh level loog
language:-
program instruction- Gieneral English language

② int a=10; Translator

A
& int b 5;
Torget code
=

?
int C= ath; machine code
④ [Link] m(c); Compiler interpreter
with Java
Programning with

plateform Dependent
language Compiler Target Code
source code

abe.c "100%. machine code file"


①Hp computer
②Dell Computer
*Clanguage Compilation
Process

* Java program Compilation Process-


plateform Inlependent
Java Compiler Ryte *80% machine code.
Source code
code •Javac * 20%. source code.
•Java file •Class file

machine) Executable
JVm (Javavirtual 100% machine code
file
Byte code machine Dependent file:
Interpreter

•Class file JIT(Just in time


ompiler)

* Java Compiler Javac

→ Java Compiler Java &f source code file (ravafile) 3) Byte code
में (nvert करता है।
- Java compiler Java file को class file में convert करता है।
* Byte
Byt codel-
यह एक Java nagie code होता है जो कि Java prog
program
platetom independent बनाता है
Byte code er Java plateform independent
code होता है जिसे किसी भी Jum (rava virtuat machine) enabie
Machine पर Run किया जा सकता है।

JOk (Java Development kit)


Jvm (Java virtual machine)

JRE (Java Runtime Enviromment)

JDK
JRE
Jvm

② JDK (Java Development kit):-

→ Tok एक software tool होता है जो कि Java Program को Develop करने


के लिए Environment providle करता है।

-JDK = JRE +Jum


G
Java Development kit + some ather libraries file + Documentation

② JRE (Java Runtime Environment):-

→→ Java के Program को Run (Execute) करते समय काम में आने वाली
Libranes file pwide करने का कार्य करता है।
(Javats pregramost Runtime Envtronment provide oC
JRE = JVm + libraries file

③ Jum(Java virtual machine):-

→ Jum एक imaganaries machine (software)होती है जो कि Java में class


file (Byte code) हो Executeable file में convert करके उसे Execute
करवाता है।

Jvm = Class locder + Interpreter +JIT


machine
Independent
source code
code
Javac Byte
code

• Java compiler •Class

machine 1010/00/101 JVm

Dependent 10/100/0/10
•Class
Code 01/011100010
100% machine code

(Native code)
Java

* Java History!-
→ project Name - Green project (Green Team)
→Development start Dec 1990

→13 People (व्यवित)


→leader→ James Gosling (Java Developer)
.→ Starting Name Oak
→Rename - Java (1995)
→fiast version Release:- 23 Jan. 1996
JDK 1.0

-.Cmpary Sin ico ysten


-

+ Orecle

Classification of Java!-

Standard Edition of Java (core Java)


Java
SE
1. Console Application
2. windows Application
Java
Enterprise Edition (Advomced Java)
EE
1. Web Application (servlet, Jsp)
Java
micro Edition
ME
Java
Imicro Appliadion Develspment-T.V. setup Box

Java
latest GUI Design
Fx

Java smart card programming (o


(credit,Debit)
card metrr card)
Java TV
Smart [Link]
API
* Oak goal-
→ Simple, objectgriented, platetom independent, secure, programming
longuage sr Develop RE1|

00ps:- (object oriented programming language)"


Class $ opject
→ Encapsulation
→ Abstraction
inheritanee
→ Polymorphism

* features of Java!-
simple&familer
Object oriented Approach
③ platform independent
④ Secure

Ⓒ multi Threading
Portable
Robust- Runtime Error minimum
@ Architectural Netural- Byte cade, datatype size fixed
High Performanee
Automatic Grark
Grartage Collecter orc)

Xobject-oriented Approachi-
Class $ object!-
keyuwerd+user Detine
Class Demo class Name
method
६ keyword a=10

Public satic void main (string ac] b20


ελ
Access sumlatb
masy fier Class Array
int a =10,
Dada type
int b=20%

[Link]
3+
·pritln("sum'+(atb))'",
3
Predetined object funation
Ctass

Class Demo

Public Static vold main(


main (Sting a])

a=10 int a=10' printf(c
16-20/ int b=20;

System-out. Print In ("sum"+ (at)),


3
print/Display Demo Java [Link]
3,
Compilation:- Javae [Link]
Execute!- Java Demo

7 Public
3 class Demo7

इस Program को Demo Javaके नाम से ही


save किया जा सकता है।
3,
→स poogran कोकियाDemo-Javaहै।के अलावा किती और
Class Demo-

ε
से नाम save जा सकता
save-abe. Java
3
compile!- Javae [Link]
→ compilation के बाद, class file हमेशा Mas के नाम
से बनती है।

Class Demo

ε
Public Static void main (int a)
ε
3

Public Static void main (String ar])


E

3
[Link] ("Aost Java program)
3

→ main method को overtoad किया जा सकता है अलग-अलग Paramet के साथ

Class A Class main call


ह Jvm
ε
int a = 10; Public static void main (st moin Csting ac)
int b =20; ε

Void Sum) 1/classname. Refenence =new classname. (U;


A ofj = new A();
[Link]. print/n (at6); Object create
-3 [Link] U;
3 a=10
3
obj b=20
3
Clar
988 A Class main call
ε ह JUM

int a;
Public. static void main(stringa
int b;

3 Void sum A obj1 = new A );


Obj1.a = 50;
[Link] (atb); Obj 1.b =100%
3 150 (300
a=056 0=0100
·Oby 1. Sum (
3 0oj16=00 0bj2-6=0200 Aobj2 =new A);
sumu Sumu
Obj2.a =100; obj2.b=200;
-[Link];
3
3

t Command lime Arguments:-


Class main call
ε
Cominand line Argunient As a strinB
Public static void main(String a])
Aray RASSकियेजाते हैं।
Σ

[Link](ar27);
3
Σ yadav

Compilation Javac main [Link]

Execution Java maim call sunil yadavsir


aloJ a3 a2]

Deve
Class Demo programmer Exam.2024 (RPSc)

public static Void maim (stoing ar])



ystem. out. printIm (ac2);
3
Pregran को Execute मुखाने के लिए command pass ी गई
Java Demo o 1 2 3 तो इस program ot outpult कथा होगा।

cutput 2

Tookeni
Java program में प्रत्येक Individual mit Token कहलाती है।
Class Demo -keyword
-identifier
3

Public Static mainm


vold me Cetang adD -literals

+ separators
mt @e0 - operador

Systemooutoprint In

→ keyword!- Keyword
keyword Java of Reserved wood End & BRT compiler
पहले से ही जानता है।
→ Java में Approx 50 keyword होते है।
for new switch
abstract Continue
assert*x* default goto paokage synchoronized
do if Private this
boolean
breack double implements protected throw

public throws
byte else i'mports
enum**** instonke of return tronsient
Case

Catch extends int Short


try
Char final interface Stadic void
long Strictfpx volatile
Class finally
float native Super white
Const*

You might also like