java practical
java practical
Jona.
4 Threadniame: = Hele” Jawa.fi
| | oe
| | {ove} J
LL - oo
\: i
7 :
3.) Wuite a poo TBR. plod au >
| the ae Ant ;
t Earn Vowel, Doula,
[. | 3 seconds
{| | paseage abo.
KS Alin pote Jawa. lang.*
fl Import Youn. util. ¥, :
il dass vowel extends Thread
1 4
i “Shing 315
I, vobbels.(. shag 8
{! 81-3585 f
i SY Starks 6) 5
| ~pusuie votd run C)
| | System. out mnintin (" vowels axe. ”);
{{ forint |¥ = 0; 2 9), length 5 44)
j f
ax aie 8h. ear At Ct)
!
h—
-Qublie Atatio —yotd mauin (Siefn 0 args)
7
IS ¥
[i Sconney $= new Scanner ee
| System. out ptintin O eutey a Abies ws
7 Shtaat Str =e oSn. next >
\foulls vie? inew!i vowele Str),
4
—
Olp : enkr a dhuug :
ee Hels owortd ©
voweds are:
e ,
0Paga No| 2)
(bas
SW) Puoquam 4 dajiwe a tivead 40
ng tere Tom output poe _in?
MUU es vifimes Cuate 3 head.
Oud Kun tem. nas the te Sn’
[iene Ds 18 dread afin” Kelle “ 1ookemes.
Gi) 1294, Hyread. Pfnts ” Guied? Morning” 20 time
(iii) 84 thyead Prints * SiviMam” 30 mes,
fmport _jowa. fo. * »
T uv :
Emp ort jaua.1ang. Sting. "5
I v ovsins!
cass emo \ exknds. thread
;
Sting msque” os
tnt p>
aaa _( string sq tat nd.
i. Hats. m3q = m3q >
Hun C=" ng
Le
3
pes yaid sun 0?
fl hey
t
d
for (
fA = glee Wis la).
im
System. out: printin ( msg 4 tie Himes”; Cott ( Envepiton ett
=
Plubilt oe elaes abe
‘
me Ataliy. vod » maitn 6_ (rng 6 ares )
t
fat = Integer. parseine ta
demo di =" new demo. (
Helo nds
dl. Stayk bd.5
demo dr = new demo (" a Morning’, # +10)
d2- Start Os;
demo dd = demo: C2SIR[ memM", nt 20)5
« Start Oy
586) Wie o pana _| ‘dat _mplements
a mutt madly Iogptization tad Inad tice
threodls = [St th quarate Handove
" y wl i Value Le
diukegty vu ovr10 accoud aud 4 Ve
Lo mo. duc ted pone 37% paneacl
Lill padi Hire vaUre 6 mabe:
i
mp ort. wan whl. Randomiiy omsh
Coes Aguare wrttndls = Thkeaof
‘tnt ©
Bquore Cink nro vse
w= 5
pubic votd sun
int Sqy = UF my
System “Out: pulaHn C" Square isi" ++ “=”
' 5
Hy + $qx)d >
[ Chass Aube extturds Lreod
d
«fat w5
| tube ( int n)
I
wenF
no] da,
| puso void run ()(Pecono]
4
a)
(Gee
tak wb = Uh KD
__ System owt prfntin (* cube Ie te 4 =
! 4 wbd 2
}
Claas Number
3
t
wctends _Threod
public voud
youn
t
Random yvandom = new Kandom (5
| for. Cink 1205 TAIOy itt).
“fink Tondo mfnkger = random. nextInt C100) 5
System. out: prinin Cy
4 Ranolom Sakeg es genvxated
+ Van dominkes er);
Square $= new’ Square Lrandontntegerd ,
8. Stout 0) 5
whe o= new ube Crrandorntateyr) s
c- stark O35
Tou -
} i
_—Thacad - sleep C1000);
ba
2 Coes ( Exception ett
4
}
public. Atttic votd main CString C1 ange)
7 g
Number num = new Number 05
num. Start 0),
3site a pane _poungarn iw _dubsices
ssead pe 6) 600) iw | he
tw overse! gubten _purom (00 40 |! auy
thamge ne mame 1 bead. \
|
im port 4Ow a. fo. #5
tmport Yaqwanlang: ‘Shot ,
7 Puchi cles
{ 4 bo
7 Past Atatin “Voldman (suing 63 Cas)
“Thread Hakead = new Tread. 1
for(fabie 100; fr=ty i} n ~
Sesto ¢ Tasca. nncutTintad v.]
ame +” %
ae
Foden tp (1000) +,
NN Claterrup ed Db
Oy 7 ee cinwttiben tose
2a4 ()- SetName ¢°
Thxtod. errreutTrreadt ). getName). equals
(" Forward!) 2” Reverse”
t “forward” ),
a ~ pos
thread. setniame (~ Forward") 7]
eae Atouk () , a)
Ss aeASSTGNMENT- |
6D weit a _ yam ; ;
| a create ! oe puayearn i Ae fathaucc
Inout
—. date
| a. Sequel
é. Haplay
ovt 4owa. io. #5
ort Yava. sql. * >
tim port) “zowa. lang. £5 i §
1
Publ, cabs menu!
—E———e IPBC_Progicam: ing. i (a jor 25
|
i
t
t
mp
np
f
{
}
pubut Atatio valk main (Shing 3 args)
Connection. ons :
Realeset _ ¥S +
Statement St >
fant 0. th,
String nd, Pers Shing. Sql >
BufferedReader by = new BulferedReader (
new) InputStream Reader System. in Ds
’ mes
Tease forNlame (1 wom. mysq) 4dbe.Dstver")s
othe Dsutver Manager -gerCannection (" pabe :
eq]: Locagwost \: 3805] couege *,\"vopt”,* vot’),
at 0 =! co. createStatement Co”
Sustem. out. printin C* connected ")5
Sql= "create table Stud (rn0 MEG), $name Varchar
"(20D 5 per vardnar (2095
Fst. exeoute C sql) >a
=
a
do
iu { 408
| System . out: pink Cl __ insert")
System, out. prin (2. “update Js
System. aut: printin (°3 Sleauel~) »
stem. aut: ipofatte ("4- oerete ")>
System. owt, prinHa (" 5. aa 5
Susktm. dat. printla( "6. . ewe GJ sn
System. aut Eenbln: ("Cuter teetune
ch = Inte er. paxserat C br! readline O).
Switth Cth)
=
case ti. —
System. Ou. siren (" eutth tire _ATudent
SAUL No nome and percentage ") As f
10 = Integer. arseint (br. veadline 1),
na = by. readline Oo
per_= br. readline 0»
String . insert =” insert into Skid values
Ci ano +" “tnat’ ',! Pe peri’ Jaye, i
K = St exeurte Update ( fnsert),
/ felkro) ' 7
| 7
System. out. printte Co yews second fs
\ ; inserte lt "> .
| | ~ beaks -
| cose 2: -
System. ot: peonttn (* eter the rou 20
Utils ay Wamt +0 apabes Dsfat r= Faregen, pastsetnt (br. veaduine ());
1 Systern ut. ( eutey Alideut name ds
String nam = by. readline (3
Sysieh, Quit - Pruiakn ( eubtr pucentage “)s
Shing pert = br. readline (5
Strin top = date Stud Sek Snamez(/
"tnam" |
whebe "rno = "tas
K= St. re tee
MC Kro): :
sapaahet Oe ee Mod és
> beeak 5
Case 3°
System. out. printio (—euith. iideuk att Ao
Securely ")
fat wr = Integer. paxseint (br. aetadline 0),
Shing se = “sett * From Stuck Where TAO =
Yt Tee
wile C78. next)
{
Cx. gektat Cit." Le" + vs,
gusting 0) + bt geshingC3),
4
buear 5
(ase H:
Systere. out - pains ln (.* enter Mideut oll no
Au waut 4d delete "+,
int or= Inequs. posssernt ( br. yeadline oO);{ose J
“aelele fuom » Maik Moths 70
Sti a4 hz
= tay
Ke St exerute Lipalade (A):
(hOK ro).
a aut: priate’: yas seco £v. oleloted*}
becca 39a
case 5:
TS= St. executed uy (" Seteck * from Acid"),
pAle C78» next OF L
System. aut: fan (7S- eiar iy © n\e" +
s_getShing C2!) + "LE" + #8. getstring G))5
mt j ,
case 6:
v Syskem. exit C0) 5
4 i
i
wwe (W!= 6)4
Carn CE acepon € )
ie
Syskm- ou: priatle (eds
LED ae
~ 4
“
3: a De cake ataclenk
L "ete wuthy atbucthaes end Snome »feh-
t im port fowa. fo. %s
| tmport fawn. sai .¥ >
tee ae OU
i
‘public atatie void orrain (String C3 oS)
5!
‘wnnection o>
Statement $ 5
Py
I, d
“ uass. forName (com. mysql. qb0°- Oviver” )>
C= Quiver Manager. gercihinention (7 polbe = ervgsql
I Covaltvost : 2806 / college" woot”, " rode"),
System. owe: prtntin C” Potnbase connected, ,
Jis= C. crcabeStatement 023
Sing Sql =" Ureate table atadent( ino tnt,
Sndme Vaxchar (10); per tak)",
By Facade paste (991 4s
A S$: Wose
1c ose Os)
TS Cakes CE nceptton eo 4
System. err. prfattn (25
¥. T
— System out: printn ("Sable wleated “Ds
3a i,
-~— 83) | Wits “a gown po ee
II | able white aealece
To Et Ename "anol: Aalasid oo NS
! To eabr
Papa y
Ox
L—_| See
ane
Lt __ tmport a. to. *. bi -
Public ckass demo
i
Lo
| peed Atalic vord matin (String CI
A
id
| Connection 65
Statem enti..Sty
Rell Sek F835
Chass. forName-(" com.
C= Brive manager, qeraal
‘Wtattrost. + 3306 / enploy
( _St=_C. CreateStatemen't S
| Syskm. out. paintin (° " datecbase. “onnected);
cafe Bidar 3,
si
git does,
\
JE
oo
a a
T
T
4
a Sing Creat = Create able Ceno fatlu
endme vorehar lio), gat Varenay (10))";
St. exewte (oreate)
Wlumn = Sat”,
System. Out. intl [*
System. out. pufnttn: Ctoble Created ");
“string del = "alter table emp drop
a
\
“onchose ; |
Ulumn duo ped’ 3ye LEneeption e)
7 pouiatln Cds:
a
any
a
Q4) | pucite a. pave gtom' +0 delle tre
details oa by
h tather bddume
Tear “table Owithr aleuibutes tno
foams Qnd Aub eet
Tapert Lowa. to. *;
import foun. Sql. e
7: i Uaas fet
fal Atatic _vold main (Bring ed axgs )
ALS |
S terrmeéSion Gy) ¢
Statement St
Reautt$et 5
fnt_+no » K>
Stin Sub, tname »
Bubfercdl Reade br = neo BulperedReader
Cnewo Enput StreamRead en (Syst tas
Lh,
v
t
ows. for Name (tom. musal. pdbo. Driver“);
[C= Driver Manage. qgtttonnetivn ( 9" adbe : musa W!
l lowthogt : 93306) couege “, Vr root", Soot");Pagan]
ic |
St= C-oreatesinkement Odio. x :
tin" Database Cueated"):
3 stem. out. prin
Son out- peuantin Co euttr tno, name a),
Sus :
~ Sub "> j
tno = Integer: parseint (by. readline ©);
t+nome = be. reoclline © +
sub = br. rtodline +
Shing tngert =~ insert fnto teacher Value
i opt Senememin , tu Subs mtg
Kes SE. exeuute Update Cinsevt >
ie (K>0)d
se
System: ot: printlo (- spouse eeceowed FS
uusocted “Js ‘ |
(tebe ——
System. Qut- fntle (* enter +o Wont
J do aele . oo f 7
| tnt ty = Integer farsernt ( br. readline ty,
String az ° “delete fer Halli Ltr he
qo © tts
| K = St. execute Update (d2>5
Z if Lk +0)
| ye out: Pitetln weecnud Lb
7 Ss St - exewte Qu “Select * from feacher
‘ bile (7s. next ODE
Fl ysiem Ouk- Prxntin Crs. qerine(s) t “le” +45
| gersining (2) + “Ve trsgetshng (33 -Popono]
(oa
a
X
tot CE Hon €)
j cep ro
: ystem Out peut (Ce),
2 5
a
7
3
V HNASSIGINMENT- 3. eal
TP ont Soler
. ————
Qn) | wate a 0, 3 :
—
———_}
Puintiuiter pyr = ves
| pw. peintin (" “Zbody >
Cent BLOWS: '' t req.
gerrleader (" UoeH - Sr
| pe putin ( Hello © Java! Zthi>');
! pi: uatin (" namecita> Ktn>
Qddy Zl th> age lth> disease " + 9. getSrin
"Std >" +78. GeeLor(') +" Zig.
4 (2)4" eitd>
+ “ftp >" 404s. gush) éltd>"
+ “Ctq>" +48.
gettnt (ud " + 15
_ GetSwring (5)+ ZItAS”
HO Stet es Ly)
3)
7
Que. prtot Gs