0% found this document useful (0 votes)
2 views15 pages

Java File Handling and Applet Practices

The document contains a series of Java programming practicals, detailing the implementation of file input/output, applets, and graphics. Each practical includes code snippets, aims, and expected outputs. The document is structured with multiple sections, each focusing on a different Java programming task.
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)
2 views15 pages

Java File Handling and Applet Practices

The document contains a series of Java programming practicals, detailing the implementation of file input/output, applets, and graphics. Each practical includes code snippets, aims, and expected outputs. The document is structured with multiple sections, each focusing on a different Java programming task.
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

VEDH¤"

Page No.:O|
Date
Practica No. l

Aiy:- lalotte a
clus.
jovn pag3am to inplegent filThputStea
FIjavg

impest [Link].#
c l s FI

public static void rnain(Shing gsci)

ileloputShraqm in = new FiloToputStr-eam("abc tzt),


int io:
sbile(Cin,resc)!=)
[Link] printJn(Ccbo)î):
[Link])
cajch (Exception e)
System,out. printJn (e);

abe. t t 4ttach c file

This is Omerga
VEDH¤
Page No. :02
Date:

[Link]
Java I

H
H
IH

HS

o
M

t
VEDHA)
Page No. 03
Date:
Practica No.2

Aim aite a javo


a
am
to implemant fleOutpufskregm
clas

FO. java

impont [Link], a Create empty


abel. ta le

pubdic static void main (Shing )


-
FileOutputhem feute na ileOutputstrean("abel.tæt)
Shing 's ="This is my cotlsgs"
byt b): Bytsto;
Fout. riteCbi
Fout. cloge0;
into ile Succetsfl
[Link]("Haiting Shi
Catch( Exception e)
[Link](e);
VEDH¤)
Page No. :
Date :

Output:- Javac Fo. javq


Jqv Fo

aitting Shint into Ale Sulcejsfally

abc [Link]

This is y college
--
VEDHA)
Page No. :0S
Dato :

PaacticalNo.3
4im: Laite
pte qa java prepan to implement fileRead or cla
|[Link]
[Link]}
impost javq. îo.; ueloome
cls FR

publie staie veid main(Sbigg aygac)


int ij
wbile([Link])!=)
[Link] paintInCchar) );

Output Javac [Link]


Java FR
VEDHA
Page No. C6
Date:

Pracica) No. 4

inmplement Eileriter clafs.


ram totoimplement
Aim: Lite a proqrom

FW. Java Coeatean


ile ay qn

impot java. io.* [Link]

3
public stetic void main (Shing oa 0)

Cilehliter fw non Filekoitor(" 2Yz. tzt":


[Link]" This is shivaji colleae
f , ctose)

Catch (Exception e)
[Link] paintln(e)
[Link] pointln"
[Link] pointln"Suecags "):

0utput: Javac Fljava


Java FJ

2Yztt

This is shivaji collge


VEDHA
Page No. :07,
Date:
Prractical No. s

4im- lutite a
tpplet.
pryam to display eI ig
H. java
port [Link].*
Impet java, awt.
public dass Heztend} 4pplat.
uhlic void paint (mphicg
drqShing(" Hello ulortd",2, so);

H htm)
<htrm>
Kopplet cede "[Link]" wid th= 200 t =20o >

- </applat> height
<{htn>
Javac H. jqva
applatuiener [Link]!
s-x
Applevie der; H. clats
4pplet
Hello Llot

|4pplet starte
</htrn]>
haigatsidth=30o </apple>
class" "fac. cede =<APplet
<html>
[Link]
,too); fact+ is:'t FacBoia)
s af derashing
(Gapheq pain void pubaie
*i fact Fact
;iK=s:it+) fori=
înît() vaid public
l,i; fach int
4Pplet [Link] fac cls public
[Link] Impot
nt.t [Link]
[Link]
no. factoria
of findout program
to aite 4im:
Prracical
No.6
Date:
:08 No. Page
VEDHA
VEDHÁ)
Page No.
Date :

Javac Fac. java


Output 4ppletviesar Fac, htm)
|4pplotuiedor : [Link]
4pplet
facteia) of s is : (20

Appletstarted
VEDHA)
Page No.
Date :
Pr actical No7

4im:- Lite a to display m2isage wing PARAn

M. java

import jqva. ont.*;


import javg. opplet.*
public cls Meetendg 4pplet
public void
paint Cgrophieg
str
Shing
Str aetParametarl"Si")
.drasking (Str le lo);

[Link]

<htm)>
<applet code M.e< s" Width "3o0" beight "3oc'>
< PARA4M naye "S" value " Lel come"s
</ Parrom>
Lapplet>
</htrn
VEDHA
Page No.
Date :

Javac M-java
DuBpu Appletuieser [Link])

AppletuieQer;
er: [Link]

Applet

LApplelstartod
VEDHA
Page No. :12
Date :
Prractical no. &

4fg:- aite a Progam to draw diff. shape ugih


Applet
|[Link]
import java. a ot. *;
impost java, applet.*,
public class shape ezterdi Applet
public oid paiut(Gsapluics
daine( Do,9o, 60, G0);
drowReo(1o,Go,po, 8o);
.|Beat (1o,6o, o,36
daa4el0,Cpo, 70,7o o,7s)
ll4reltoo, o,7o,70,0,7S
, drgnAe1o, loo70,80, 0,7)
fll4Te(loo oo, 70,90o, 270);
dra4re(2o0, 8o 80,80 0, l80)

[Link]
ehtm
<Applet code Shape,dass" idth"3o0" heigt
</4pplet
</htm
VEDHA
Page No. :|3
Date

output:- javc [Link]


appletviener shape,htm
4pplet vieDar ; [Link]
4pplet

Appletstgoted
VEDHA
Page No. : |4
Date :

Prractica no. 9

4im: kloite q
rm to drg dra Polygon Dsit tpplet
Polyjava

impot java,qwt.*;
impot jav .appl et.*,
public clats Poly eztandy Appl:
int [J-20, 120, 220,20
int y CJ =20, 1D0, 20,20:
int n= 4
public void paint(Graphics q

lPolygen (aln)2

Paly htmd
<htm>
<Applet Code : "Pdly
Poly.. clags"
ags id+h"200 " height-" 2so">
</Aepl& height
<lhtm>
VEDHA)
Page
Date:
No. : 1S

output javac Polyjava


oppletvier [Link]
Applet Vieder: [Link]
4pplet

Appletstort ad

You might also like