100%(5)100% found this document useful (5 votes) 24K views130 pagesJava Programming Solved Manual
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here.
Available Formats
Download as PDF or read online on Scribd
Java Programming (22412)
oF
YIM. Resourees required
Sr. | Name of Suggested Broad Quant
Resource Specification Manitty | “Remark
Hardware: Computer (3-15 preferabley, |]
Computer RAM minimum 2 GB and
System onwards A
«| 2 [Operating Windows / Linux talc te For all
sytem. tch size | Experiments
3_[ Software Jgk.8.0 oF above.
1x. Resources used
SNe! Nencol Broad Specification Qty. Remarks |
Resource y Grany)_
T | Computer TEntel pen Hom
Syme atl ee 68 aB
wit roa 2
Specifications | 647 DEE o's
2 [Software | AlEnenteate
3 [Any other
Marcoued | MD EERAEL |
x Practical Related Questions
Note: Below given are few
‘more such questions s0 as 10
1. Write installation directory path of your directory?,
2. Write value of path environment variable?
3, List folders created after installation.
4. Main method is declared as static. Ju
‘5, Program is named with class containing main method. Justify.
(Space for answer)
sample questions for reference. Teacher must design
ensure the achievement of identified CO.xn.
XIU. Assessment Scheme
Performance Indicators Welghtage
& Process related@Gs Ma 7-4
& ie fomation 1
Logie formation 0%
2. | Debugging abitny 30%
3. | Follow ethical practices 10%
Product related (15 Marks) 30%
4 [Expected output 10%
‘Timely Submission of report 10%
6. | Answer to sample questions 10%
‘Total (50 Marks) 100%
List of Students /Team Members
Dated signature of
[ Marks Obtained Teacher
Process Bement Total (50)
Related(35) 2
anne of Techies!tava Prograspming 22422),
trate use of if
: : Develop programs to demons
Practical No.3: yer ants and its different forms.
t Tresmputrlenee, condi ts, expressions and constructs are pert
computer science, conditional statements, exp! | conatwcts ar
Bree wShahutons or actions depending on whether boolean condition eva
luateg
to tne oF fase. Students will be able to use various forms of if statements to check jhe
condition.
So ae :
Reema Or PO als tt, whem
a tno Aly owe of bce ah
see ee a a omic: io
Besson owe: An
Experiments and practice: Plan to perform experiments and practices to use the
results tesolve the computer group related problems. ; 3
Engineering tools: Apply relevant Computer programming technologies ang
tools with an understanding of the limitations.
Individusl and Team work: Function
in diverse/multiiseiplinary teams.
‘Communication: Communicate effectively in oral and written form,
‘Competency and Practical skills i
“Develop Applications tsing Java", ,
‘The practical is expected to develop the following skills:
1; Write a program to use simple if statements to check conditions
% Develop program to use diferent forms of if to check multiple conditions,
Relevant Course Outcome(s)
Develop programs using Object Oriented methodology in-Java,
Practical Outcome (PrOs)
Develop programs to demonstrate use of if
: effectively as a leader and team member.
‘Statements and its different forms, 3
related Outcomes)
90d housekeeping
uate working as a leador/
S.
evant Affective domain,
team member,if statement is simple decision-making statemen
certain statement or block of statements will be
condition is true then the block will be exccuted ot
Syntax:
if(condition)
nt. Its used te deo
executed oF Not, ig,
therwise not,
Ho whthior a
Wa ceutain
1/ Statement to execute if the condition is true;
)
if-else: The if statement alone tells us that if
block of statements and if the condition false,
Synta:
if(condition)
't condition is true it will execute a
else block will be executed,
1 Statement to execute if the condition is true;
}
else
11 Statement to execute if the condition is false;
ui
nested-if: A nested if is an if statement that is the target of another if or else.
Nested if statements means an if statement inside an if statement.
if(condition!)
{
/ execute when condition! is true.
if{condition2)
{
execute when condition? is true.
}
if-else-if ladder: A user can decide among multiple options. The if statements are
sncecanad feoes tp dom. Waan ane afd te true, the statement associated
with that if is executed, and the rest of the ladder is bypassed. If none of the
conditions is true, then the final else statement will be executed.
VUIL. Resources required (Additional)
Nil
IX. Resources used (Additional)
. Remarks
Sr. Name of | proad Specification | Quantity | Grany)
No.| Resource ;
used 043s fF 4
"T 0 Pharere
E 7 [Any othr ALstep zal g.-
resource
' 3
"Mtarasira Stare Board of Technical EducationJava Programming (22412)
X. Program Code: Teacher must assign a separate program statement tg
344 students. sing if statement.
Write any program to cl
Class TF Stasement
heck multiple conditions u:
a is 2
2 hte shedte uotd main Co stu'ag ary 3)
Pods
ee S= new Seamer” ceyshm D 7
Sy fe souk prio Ho Cc‘ enkn fae mamber
¢EnN€EC)3
Gnk- number HS NeX
PE Cramber ¥ 0)
€ athena print C" pbumber poositiue.
Ssystemsoak pintin CUTEis statement 21
Ercecuted ‘D3
%
esse (Output of Code):
executed j
else part wil ne
f condition is true.
executed with example.Java Propsamming (22412)
ee
4. Which of the following operator is used in if
a Assignment operator (=) "5. comporion operator (=.=)
(Space for answer)
190 IF, Condittonol Atalement
sh itr z
yoo "fs used 40. ole Clare
bee... te
Maharochira State Board of Technical Educationaa
soya on ae
fio! ean
Prog ae te
5 pase watsfunn (29419)
XL Hxovetgo;
1
+ Wette output of code in tho
OREM Conte
Hiixumpie {
| puiblie tian Wor
Public matic void mnin(striay, arpa
int nume70;, a Sein
i nume 100 94
Syatom.ont.printin('y
ifnume 50)4
)
)
Public static void main(String] args) {
int number = 10;
if (number > 0) {
System.out
executed.’
) NIA
1
niven apace,
es Owput
‘number i fons ton 100%,
System-out printin(*number In gremer than So"
)
i ———.
‘class 1fStatoment {
System. out println("Number:is posilive,");
}
rintin("This statement is always
Alumber > aang
team toy
%
[[Molatien recessiog.
Je Soeprtiity
© |rousited A errer|
2. Write a program to make the use of logical operators,
i eck n0 is even of odd,
Hee ea eee race EAT)deconstrate use of, ony
pene Na Det EE tit 8) smh
rh on
Rete =
Sec =
rm
fa A
ead
BW. Relevast Court Ortexaet) ee rohawrees | notepad a
Develop programe using Otject Oriented methodology in Java. ot
“om a gprs tte meneame gt
op OPE wees th ce stent sa eh «Wie pon ingore me
: Class Demasasiteln:
titi)
E putt. Seatte. Usd onain RsriagergreD
sa Integer. Pete per Cage £0);
1S Zonyen parse Tnb Carp f23);
na Finteyer pouse mnt Cargs C2T5
ae cea)
Petry: system cut: printin CV aston Bee 3
: break j:
A amannak
“Reet Chee Ce
addreen =34
hile Sten Seek cha 4
Savas). Stting elassara
2 BRB owtsol” pecansse
System oot
vv,
Coie Ae areid. rain CSbrRag =9+63)
ent Cars et)y
Labite Btaire” Geajel IN Benne
Fpaatin Count "a prin nedwit ply towing aac reese ma ee
a
Ea
a
=
=
=
ie
Ea
adfe Btad te Laetd main Cabiing ang st3)
[riven Cs Be Mae EDT so
Bh Heda tnt
ROB er2, Wes program to pay mambet
XIV, Net Suns ure Reig
‘ape codstape come leon
2. iptv youtube conf water GcetT8
3. pssfwor jumaier,sf Souder Texm Members
/ Pied Dad signtare of |
| ebaite, | rosie
racial Outcome P29)
Ft Otten rine of mpi ype eating JannTSAR -8
a
Ei Bil abt a taste ate ©);
be
Pabirs cents ptt Caulng
fee
Public gfatre Ueeiel mln Csiring argeet)el ase
ne hein at
th, enon al bale
i ede aie
rape eee wn
rcpt ee bn te
Pinetparcnenvuag saat
AA, Relevant Cour Outcome)
Develop grate ng Objet Orel wetotaegy ine
y Practical Outcome (908) ke
Develop programs doustat uso vA’ Moonie
Dated signature of
Marks Obeained "Teacher
Proves Product | yyeatso)
reared | Relateaaisy | HE
naa. .§ leeacl
amare");Practical No. 7 and 8 Dovelop prograny
Hi
type ensting in Jvar Part AMDleOnentaoy
Mem T And Payt i, OM ngihest
Practical Significance:
Assigning a valuio oP one typo to a vatlable of
sign 7 y itforeny
When you assign vale of oe data typo to anther tne 8 MO 0896 Cony
compatible with each other, Student wil bo ule! YP MMW ig gee
conversion between data types, ° 10 indersind impiety
Retevant Program Outcomes (POs)
# Basic knowledges Apply knowledge of
cuginecring to solve the computer group relat pra PAN ae is
* Discipline knowledge: Apply Computer Progam
computer group related problems, M5 knowledge to wale the
+ Experiments and practice: Plan to perform
results to solve the computer group related prot oad Peles to se toe
+ Engineering tools: Apply relevant Computer praprammt i
tools with an understanding ofthe limitations, ne mmME technologies ena
* Individual and Team work: Function offectively as a k ember
in diverse/multidisciptinary teams, eee
* Communication: Communicate effectively in oral and written form.
Competency and Practical skills
Develop Applications using Java,
Relevant Course Outcome(s)
“Develop Applications using Java”.
The practical is expected to develop the following skills: :
. Develop a program to show automatic conversion between various compatible data
types.
Practical Outcome (PrOs) ee ;
Develop programs for implementation of implicit type casting in Java.
Relevant Affective domain related Outcome(s)
1. Follow safety practices. _
2. Practice good housekeeping
3. Demonstrate working as ale
4, Follow ethical practices.
ader/ a team member.
i ound /
Minimum Theoretic er onversion: Possible wen two kypes are compatible
‘idening oT
7 weet type is greater than — a
it It in loss of inform .
2. Narrowing may resu!sce (22912)
Result Output of Code):
a hae
XIE. Practical Related Questions
Note: Below given are few sa reference. Teacher must design
‘more such questions so as to ensure the achievement of identified CO.
+ List different datatypes according to storage pacity.
. State need of typecasting,
. State the data types to which boolean datatype is implicitly casted,
|. Write two examples of implicit type casting.
imple questions for
(Space for answer)Jaya Hogan NN)
NUL. Byereiser
A. Write Brrorfoutput of cote in tho piven apace,
Program Coto eevon/Output
hag PRT rn i
dublic stato vote ming Sti
Tae ednGSenall orm) CT Anke Cetue 106
Jong Lt;
Moat tl; Long Leatece too
Systomout print nt value");
Systomont printla("Long value 4);
System out, printhn("Flont value");
oat Leabue (were
public class Test{
public static void main(Stringl] argv) {
‘shar ch 'c';
int num = 88;
~ ch num;
ta com paki rhle
Aypes possible
sorely con eersion
fuer ink He Char en sjrum;
3. Write program to implicitly typecast lower range data type to larger storage size
‘datatype,
Class parent
peebtie caoiel Ais Ploy i
calted"') ;
ybien tuk prinddn 6" parent alSP
8
5 fa7an
ues ue CURAS
"i & parent gyadre CeOr
a Extend poren ls
i © ain Catring argt t33)
pes etl CVF
& poorest P=
Parise) 3
Fave Board of Technical education3 tose te ap ge rad ean ME PH ee
Rafincering tools: Apply relevent Computer progammi
SEES resody otto” MEENTN og we
Individual ‘eam work: Function effecti
i d Team effectively as a lender and team member
; = fe
Communication: Communicate effectively in oral and written form,
TR Competency and Practical skills
“Develop Applications using Java”.
‘The practical is expected to develop the following skis:
1. Develop 2 program to show use of explicit type easting
Relevant Course Outcome(s)
Develop programs using Object Oriented methodology in ava.\
V. Practical Outeome (Pr0s)
Develop programs for implementation of explicit type conversion in Java,
VIL Relevant Affective domain related Outeome(s) { ‘4!
1. Follow safety practices. — 3
2. Practice good housekeeping
5. Demonstrate working 28a leader/ a feam member.
4. Follow ethical practices é
Miaimum Theoretical Background
i jicit Conversion '
cate pet
EE explicitly or narroving es
7 is use ted conver th specified vale.
2 Here,
SEmOr ariableName ~ (887299 voinleTabomet
Example: © ae |
feeta-52; 8 i"
‘int b = (float) 25sana Propo
onal)
vyitt, Resources i
Nil
se =
1%, resounces used sons ;
x te
Quantity ™
2
road Specification
\
sdk yet
neorepetl
\
X. Program Code: Teacher must assign ® separate program statement t.
4 students.
aeeai program to show the use of explicit YPe casting.
Public Class Soyalicee couhry,
é
“ee geabke Usted main (sHirg arys£7)
Arusle td 2 45-0
feeak = Coal 4
dors L= Clary) GF
fake Cinedty
Sree S> CShert 5
ih . ;
dues ths
pombe C¥ doubl
Mten aut pr tn nfeaat Lactan =" aay:
sein at om SMe nag = 4
BASOM wu ce ©! Stet Soe ey
Batters cour taste "Sab athe = 4 gye
= ” a
a tr adi)
Co byte nee
© thse
Me):
Result (Output of Coa,Java Programming (22419)
XII. Practical Related Questions
ores Below given are fow Sample questions fop ities,
3 What is difference between impli And exDIic ype casting
3. What is Harrowing?
(Space for answer)
alstng Bhjeck a6
oleae object
Seomhable v3 toptr
SA paragon tir
beh eee le types:
2G Center ster, gown
04.9. Srralicdr
oe int Cae bitsy
stop Cam oceurxm.
1. Writs Ecorfoutpat of code in the given space:
Program Code
1) cassTea
a fe void main(Strit if
poble sate oid main(String gs) {
{ong | = (Hon
inti = Gin;
‘System out printin("Double value "+d);
‘System out printin(*Long valu “ay ”
System.out printin("Int value "+i;
}
i
class Text{
per ties main(String args[])
b= (byte)(b + 2),
; System, ut println(b),
{ava Propramming (22419)
class Te:
Public static Void main (String ay
byte ea, at eugsl}) ¢
char b=,
shortc= 102;
inti 5000;
float f= 5,
double d=
double result = (f+ a) 4
System.out printin( “res
Gt) - (4 0),
It "+ result),
1
2. Write a program to convert variable of basic datatypes and shows result of explicit
‘typecasting.
(Space for Answer)
5- taut °
———
grea Eeaon
‘arava Sire Board of TechnJava Proj
lL
vu.
Practical No,
10: Develop Program for
multiple eon ‘ntation of consteneto,
Practical Significance; - -
Weed nai POEM gy
object in divert, Ue. Ditteren ens consti
way,
for creating the object” The student will be
ing language j
Relevant Program Outcemes POs
* Basic knowledge: Apply ney)
" + lea le
Disc cows computer group elace aS, lence and bse
. ine knowledge: Apply Ca k
compa eS: Aly MPU Programming knowledge to solve the
© Experiments and
* Communication: Communicate effactiv
Competency and Practical skills b
“Develop Applications using Java”.
The practical is expected to develop the following skills:
1. Write a program to initialized objects using constructor.
2. Develop a program to pass message among objects,
Relevant Course Outeome(s) y
Develop programs using Object Oriented methodology in Java,
Denalop programs fr iplemenan of single constetorand mule consul.
Relevant Affective domain related Outcome(s)
1. Follow safety. Practie
Object
public boolean equals(
| anotherObjec) ae]
ignorecase
lic boolean equ
nd ret
Compares two strings
‘pve strings, ignoring eA5°°{suriay
< bookkan ead With(Suing
Reiumsa string replacing all the
CharSequence to new char or
Sousa
“A method rehire index of even cage
value or substring.
Retums new string that is a
string
method returns last occurrence: ae
character value or substring.
Task Performed
Append pele SingBuer wis
StringBuffer
= s | (SeingBotter Sb)
This method inserts a caring Sat postion
[3 [Seine inset int fet
} 2 | suimgse) mentioned by offset. a
[TS [weld sei ensthfiat now Seis the length of the character sequence —
“The character at specified index of this
| 4 [rosa eacoeainien aD) Te ad bol g
g 4 TReverse the character sequence in thi
;s | scingButier evened) ane al
vo. Resources required(Additional)
NB
mx Resources used (Additional)
Nemeof | — Broad Specification Quantity
Resource
fol ted fe
motepecel42M Cote Teacher mag,
4 students. mest ay
Write a program to shove the Se OF metho
Clas Stvtng ARC Heo of » a
PARE St0C LaBed mat Cstrto,
Sting cep —v
String gree
8 sepa
BP separa PrOREam state,
Ent to
i Brow ers.
‘Sting class,
1)
2M FE Ren aodeesgnrdt OE
NE Sate
Strings, = Oyaseal,
Shingss = Mette Fann,
Bry Stem vou. Proten en Char al Enter
44 Stem out- PPatin Co py
SY84om out printen Ga
AY Stem our porte, Ceceleing gem)
Sihtom out prialeyy C'Cheetes,
AL way PME C9
BUSH gush ria ey t's
Sy Stem enh Pater d tig
BY stem ub Praten Co Cane: oy
BY Stor ok torn Hn CMepeer caret g Ste Upnerense. ¢> dS
BY Stun Ouk pretnt ty CT ntag She, s
Ay stem out (P77 OHS 0 airelin, tbs tr centans 23199:
Susters outl [Pon ban! Ceracking sae
“8 Str comtaks 3033
CPAP EY ahae Oey = 82, ata ‘eben array a
A ttom aut priakhn
MepPlateg usr, Meery ny:
She “Subthing cp 2 7
bstring Cg, 123%”
Zé
CSTR Ok anew ny eee
Beem, out priate 6" printing fase eeerwent af am
1 Carteret ze);
4 :
z 7
Mibsashira sardof Technical Education ——SOS~* —— Ss
3rd of Technical Education
State Boaireference. Tea
‘dentified et
with syntax
ole ‘lone ‘with syntax. |”!
er we class in Java? State th
ord compare To metho Neb
2. List difte
3. state whether
4 Whit is ifferet ies et een"
(sp coed
Ader
Maharash
alia
ate Dourd of Toca
ial Ea
inal
meri gneot Pasecage
‘XU. Exercise: . sr
“U1. Write output of code in the given space.
Sr.
oe Program Code Output
Glass String_demo{
public static void main(String ares[)) {
char chars{] = {'2°,"b",'c"};
1. String s = now String(chars); abe
‘System.out printin(s);
}
}
‘elas Output{
public static void main(String args{)) { 4 alte rae
‘String s1 = “Hello I love Java”;
String s2 = new String(61)
‘System.out.println((s
slequals(s2))s
}
1
2. Write a program to implem
yaya
ent al! methods of StringButfer class.
eeBb: aghhte
Bysien
Bp rey irs
BY, eds tof
4Sava Progra .
im for imple
Practical No- 13: De’
v.
VL.
‘VII. Minimum Theoretical Background
mentation of Arrays in j
velop prost#
data in consecutive memory 15
Sf
type of the, Students will be able fg
jeal Significance? «same typo
Aten wll help to fetch daa”
Mipefer multiple vatues Wil
outcomes POS)
a otapnly knowledge Of bs
Ive the computer BroUP relates
i ge: Apply Computer Pro
. -d problems. ; ry
_ pane pra Prooran to perform experiments and practios to
weiiits to solve the computer gOUP related problems. ;
= Basinesring tools: Apply relevant Computer ‘programming technolo
fools with an understanding of the limitations. 3
Jndividual and Teamwork: Function effectively as a leader and team me
diverse/multidisciplinary teams. F
© Communication: Communicate effectively in oral and written form.
ic mathematics, sciences
.d problems.
gramming, knowledge to so} ve
Relevant Progr
Basic knowledg
er
‘Competency and Practical skills
“Develop Applications using Jaya”.
‘The practical is expected to develop the following skills:
1. Develop @ program to perform various operations using array.
Relevant Course Outcome(s) *
‘Develop programs using Object Oriented methodology in Java.
Practical Outcome (PrOs)
Develop program for implementation of Arrays in Java,
Relevant Affective domain related Outcome(s)
1. Follow safety practices.
z Practice good housekeeping
. Demonstrate working as a lead
4 Follow ethical pecteg, nn! "eam member
1. Creating an array
dataTypef] arrayRefVar;
or
dataT ype arrayRefVar{];
arrayRefVar = new type [size];
2. Array of Objects:
Class_name array name = new class_namefsize]
= ize];
3. Types of arrays:
1. One Dimensional
Example:‘gos Pouring 22412)
SD Sty = new ipo)
2. Mul Di si
Example:
se itAmy=. =5ew int
an]]0D datrey CC "ay orm }
YUL, Rewurses required(Additionsn my! }
sabres ped | Mem ook print 0);
EIB ay r ae
ZjIlajatejue :
S05 Fe 3p
orgeas JO &
ttm Gut paniin Gosre
23 C7142);ee
XI, Result (Output of Cole,
reneo., SOOO!
° Bane OLhS,
0000.0..10.2.:
aaao..\0 aii
XM, Practical Related Questions 7
Note: Below given are few sample questions, for reference. Teacher
sions suck questions sas ro exsure the achievement of identified CO,
7 What is use of new operator in defining an array?
2. in2D aray which dimension is optional atthe declaration of array?
3. Isit possible to change size of eray once allocated?
4, State the situatioa where Index Out of Bounds Exception will be generated, 4
(Space for answer)
®
idamace.
‘Maharadha State Board of Techaial Blucatog
aJava Programming (22412) | |
XU. Exercise: :
1. Write output of code inthe Biven space.
Sr.
No._| Program Code
State Tine no and enor,
classTest2 {
Public static void main(String] arg args) {
inta[] = new int(5); line 1
‘arr = new int[]; // line 2
}
}
class Test {
Public static void main(Stringf] args) (
int an{] =new in{5};
2 System outprintin(an);
‘Systemout printin(arr{O);
} 3
}
reach
3. Write a program to display array elements using for-each loop.athe Crt
se aoe ae
Sygtim out pa npriat enttg AveY Taare ay
Sygdern ous pre’
‘a go ANDY en Ualic tna de
Gir ens pacten ert meee, ase
arey in ja
"print Lealuery
qurray d0S bIAg Cine
System out printtinl
Java Po
XIV. References/ Suggestions for Further Reading
inejava
1._hitps:/Avwww.javatpoint.convarray-
2. hutpss//doce oracle comavase/tutorial/java/nutsandbolts/arays htt
3. httpss/Avww.youtube.com/wateh?v=okHLIBSrhNM
XV. Assessment Scheme
Performance Indicators ‘Weightage
‘Process related(a5 Marks) 7%
T_ Logie formation 30%
2 _ | Debugging ability 30%
3_| Follow ethical practices, em
Product related (15 Marks) 30%
4_ | Expected output 10%
3 | Timely Submission 10%
& | Answer to sample questions 10%
Total (60 Marks) 700% |
List of Students Team Members
we
‘Marks Obtained Dated signature of
Teacher
‘Process Product
Related 35) | Related (1s) | TE
A TTT ss" # 4
bhm.
Wv.
VL
Vit,
Practical No. 14: Deveton py,
eram
beeen - ‘ip ementata
si TH to use veziamle AITAY, Vegy aay
ots in the prey eOt hol
eran
Relevant Program Outeo
mes (Pe
* Ra Inowlede: ly tray
eheinccring to Solve the comput 2 Otic mathonay
+ Discipline Knowledge: Apply oqo"? elated problems“ SieN028 and basa
computer group related probleng Me Prot i,
+ EApeinen a preter f yg EME
comput xperir
Engineering tools: Apply etry MP0 ee
foots with an understanding of theming, © P°8™MINg choos and
eT a tual and Team Work: Function cffectively
in diverse/multidisciplinary teame. YS 8 led and team member
* Communication: Communicate effectively in orl and writen
fom,
Competency and Practical skills
“Develop Applications using Java”,
‘The practical is expected to develop the following sails:
1. Develop a program to perform various operations on Vector using difereat
methods.
Relevant Course Outcome(s)
Develop programs using Object Oriented methodology in Java.
Practical Outcome (PrOs) 1
Develop program for implementation of Vectors in Java
Relevant Affective domain related Outcome(s)
1. Follow safety practices.
2. Practice good housekeeping
3. Demonstrate working as a leader/ a t
cam mere
“4, Follow ethical practices. ) 4
2)
Minimum Theoretical Background, ,) | te
Vector class methods: ..ew. am
‘Enumeration clements()
Returns enumeration
vector
Tetumns first component of this vector
‘Object firsiElementO)
Returns last component of this vector
6
7.
B._| Object lastElement()
9. | int indexOM(Object elem)
‘Void insertEtementA«(Object
‘Searches for the first oceurrence of given
argument. :
Theeris specified object as a component at the>
10, stele ified index position.
bj, int index) speci _ il
So eave amen Honoves the element at specified position inj
1. | index) vector a
‘boolean Removes fist occurrence of the argument Roa
12. | removeElement(Object obj) __| the vector
13. [int sizeQ)
Relurns number of components in the vector
14, | void copylnto(Object[] array)
Copies the components of vector into specifiag
array.
‘VIII. Resources required(Additional)
Nil
IX. Resources used (Additional)
ne ae Broad Specification Quantity | Reaas
ee : m
nity sei (kd 4
2 Tavay Ofer
wereurce. Ato pect A.
X. Program Code: Teacher must assiy
4 students,
Write a program to insert different clements in the Vect
Panport jasea ctl Weelor;
genie Ceais rector Dem
Pawtre stoulre Looted maint string
argstt)
Feet < Tricor Wee? new Keeton
3 ave Fetums a new String object representing the integet
| doubleVatuety Fetums the value of this Integer as a byte
returns the value of this Integer as a double
5_| floatVah
CL I lo: jue() Feturns the value of this Integer as a floatSeema
2 ace age a
Me Peto
IM Chic has weg
Static int compare
wt int numay
Nit
TX, Resources used (Additional)
SF] Nameof
Nat ee Broad Specification | Quanity | Remarks fitanyy
1 |soeeeuaret te ;
_ Stk ver [og
2 | Tay Ohare
resource | Atotepas] £
X. Program Codes Teacher must assign a separate program statement to group of 3-
cmp tities ny Wr ema
Import jaun i.
Pebltc » crass wvvayoer Deme £43
Zrourite seatte uot mein pe
é tk Bf pie nee TARGET w2e%ys
rote i Gyec nen mnie C0")
ore wnt gee ree tntger€35;
In. err
20h g eM tes'? cn
System ou ee | con
obs st OLE Tateger : Latur @F ,
a .
m™ ca by indicate 69;
int (2,07
‘Mabarashire Board of Fecbnical Pa
By stem Oe PARLE?
tt" g yao 4 intobj 2
obj (al talabj tt" obj2 J
7sone crouse LEED
wa, Meow canto! wh CoA
se recta eed vee enone for reference, Tasch
ie wamphe grey ee
Ha te Ehime Ng ene to Iascniaa oo
ware WHY oe nt a ee w' wigs ay pre pre Bale ye
\ ie wnt nomen LAieh S20 PUTIN OAS,
4 banal
wht
we Ae via on
nee ‘capac bo OM
AVG Benleon
OB tyorasser ;
2) By Ie
wo Sneedjae a
at
tion na Alen
wb ading
im aie
f bithat a a
yw
! vate oa to oonvest sin van se ge
2 Write a prog 1 make Ws tr ebareses 0p lays ratliod
4. Write. praran mn gan mr
‘and tons valpysen ous spite Leper %. Aug “aye
nF anit oie ie
Gpster 00-7 WIRE Lia Te Mh fee
pastor tial phate Ccunrisen 10...shfy
npeeisll
cnanttsen
—
adhere os
1. haart we nach an | psd btmrogaine 22D.
system. aent anktnal
ahetem ind peat.
Ayslen Dadi (2 HOLL A
ape.ton inl pol!
Ay sitirn eto lit
) Hurthor Rendings
NIV. References! Hnggesttons for
vntolitvoIM Su6010)00
1 pazfovew. yout.
ferential oonfivarnve snr
Joyal 1
rede doottEEIAS af
ammiated nt both fo fit !,
mAh dhl gee Sonn i
Cede vil SAL? j
nage t Ade tM SAYA LAA.
XV, Asnessment fleheme
Forformance tndleston
practlocs
inted (18 Marin)
Marks Obtained
© Process | Fh
05) Pp Poduel aatedsing O12
sao nogeninn RD
aetieal No. 17: Develop a propeany
Wi
hi
vorntaing Iny
practical Signiftem
Method overriding is used to
polymorphism is achieved throug tee definitio
od
n
the parent class method or consiteete 4 Overriang ttd In ou
Relevant Program Outcomes (P03) 0 aly
+ Basic Knowledge: Apply knowledge of bay
engineering to solve the computer group recent Mts inea
+ Discipline knowledge: Apply Computer pron bem. anil basio
computer group related problems, *°8"emming knoweg
+ Experiments and practices Plan to perf mele
1m ex
results to solve the eomputer group related mong oP ote te
+ Engincering tools: Apply televant Computer prover
tools with an understanding of the limitations, "M8 technologies ang
+ Individual and team work: Function effectiy
diverse/multidisciplinary teams, Wvely asa leader and team member ig
+ Communication: Communicate effectively in oral nd writen fom,
u.
I. Competency and Practical skills
“Develop Applications using Java,”
The practical is expected to develop the following skills:
1, Develop a program using super and sub class to override the methods,
2. Develop a program using super keyword to override the methods to achieve the
runtime polymorphism.
IV. Relevant Course Ontcome(s) | a
Apply concept of inheritance for code reusability.
Vv.
Develop # program which implements the concept of overiding.
Vi. Relevant Affective domain related Outcome(s)
1. Follow Safety Practices _
2. Practice good housekeeping
3. Demonstrate Working as a I
4. Follow ethical practices.
lcader/a team member.
VIL. Minimum Theoretical Background ing inte parent
Method Overriding in Java, 1 cass) which ® already
Declaring a method in a subclass (**” cplaes
class refers to method overriding in 0°". nae
jon in the subcl
tation in the su!
jerclass by PFO
ame retur
The exact implement
implementation in the sup
parameters or signature and 5
class.
vi
B="
; ee : - panel cle :
: yo puedes enettnl
: 2 i
nes
splay =
cote?
7 1
eaten 7
. —P nly Clo M
uae)
- “oer
1 - pe
aaa oo
aligplay
adaition()
caleulatet)
ttl
ay severe oF MH
Lin, Resources required (adatom
Nil
IX, Resources used (Aduitional)
se 7 Hivoad Spieifteation
No. | Resource \)
T Trokewere | yaw het
2 [aay ofr Aol pad
wesotucee.
1X. Program Cou: Teacher must assign a separate program sin
4 students.
sernsastrate the use of Overriding method display() using Super and Sub classos
Note: Attach the code at the end,
Clas Sypor
ink 24
Sup ercint
b neds une p
3 Cecid atsyrley 0d Me me{uod atop ive
&
Beystem ok [Printen Cn
Faaharasinn Sale Doar of Tec DvcaTon
3
Super oo ne)?
/programming 22412)
pass Sub Sxdenel 9
¢ pan”
Santye t mn
getb ciat mp Toty ) ) }
é
super Cfe\} '
THES y Yoy}
Ceetcl oL®s/2 le} &9
s f
Sy St Gert: PA Ly CString 4] .
SP eo 934
System eek We nEh o CE gap “y
5 Gao ah ag
% crass OWer ride fat Re
2 it ig
Pulse SFare, Coptd
fe cen A mang rin y args c5)
= ee sts C100, 200)
Ste. ge co oF
Result (Output of Cod o
Practical Related Questions + ¥
Note: Below given are few sample questions for reference. Teacher must design
more such questions so as to ensure the achievement of identified CO.
1. State the difference between method overloading and method overriding.
2. Method Overriding is an example of..... (Compile Time
Polymorphism/Run Time Polymorphism)
. Write the rules of method overriding.
. Write the use of super keyword in method overriding.
*” (Space for answer)
AY
ira State Board of Technical Educationete
an east
id a} aapel!
RCinivednddvrey # Hint
ain f
. wt = f ae polniety
'
a edd
7 pietoad AA
Ay ful fpr real ade
Pe gate tint
Ba tayaneel Ae
and 4 Teal
wierd
pi nuidel
bie elo Get aR
ae Me Wy ig rein
Gi avigiyal eve at AML
ve
Ahiegiae baal any uit
Pee Mansi hu htt Jobat
he eeanal tees!
CLOT
Ak
fe Aawel
) 4 aul fan he pry | te
panei Ate PACE Bo AA
Wy tiper tan be cand oe
pus adi aaaentt PAB adh
eRe
1, bab
Re wlaa en 10 diitanheraya rng OF" 12)
Pd Pokey te
Dal tht
3h unerseaseeny a
Comyrtle denprograming (22412)
ws?
sam. Exe
1. Develop a program to displ
overriding method, PY the rato of
2, Write the output of the following:
‘interest oF bans by method :
class MyBaseClass
protectell void isp
‘System.outprintin("Parent class method");
a MyChildClass extends MyBaseClass
public void disp)
L System.out-printin("Child class method");
Public static void main (String argst))
MyChildClass obj = new MyChildCtess();
obj.dispO; }} .
aoDevaiog speeipiociin’ ‘dog’ from ‘animal’
using super keyword.
{0 override ‘move()* method
(Space for answer)6...
yitem oul
Ayston oul printer c"re
XIV. References! Sunt
java
3. Programming
Jape /eginnersbook
XV. Assessment Scheme
| -_—~racess reated@35 Marks) ‘10%
[2 J Eogie formation Boe
| Debugging ability 30%
3] Follow ethical practices 10%
Product related (15 Marks) 30%
%,_ ] Expected output 10%
Timely Submission 10%
“Answer 16 sample questions 10%
“Fotal (60 Marks) 100%
List of Students ‘Team Members
L
2
=
4
Marks Obtained "| Dated signature of
Process Product ae
Related (35).| Related (15)
Total (50)
‘Maharashtra Siac Board of Technical Ednea
foncm
n.
practical No. 18: Develop a iis
Bram fo,
Muttiteyey lak aah
Practical Significance: tang,
eu helps to the exist
additional properties. It het OB class .
ae realty oF code, ‘p;T8tHEe the BOPEts ty
ses in different ways, a
: us
sn icierk Oxtcomes (Pos) "Se different types orintend the
+ Basic knowledge: .
cagineering to solve tee oe Mledge og basic matnemay,
+ Discipline knowledge: Apply Compt? lated Problems. Sciences ang sts
SQEPUE® ErOUp related problerng PME! Proper
* fate shen Popa
js mpater US and practo
+ Engineering tools: Apply reteyo se ot Problems Practices t0 use the
tools with an understanding of trent, Computer
Competency and Practical skins
“Develop Applications using Java,”
‘The practical is expected to develop the following stats:
1. Write simple programs S2oxtend a subclass from super class
2. Develop programs to extend multipath inheritors
Relevant Course Outcome(s)
‘ply concept of inheritance for code reusability,
Practical Outcome (PrOs)
Develop 2 program for implementation of Single and Multilevel inheritance,
Relevant Affective domain related Outcome(s)
1. Follow Safety Practices
2. Practice good housekeeping
3. Demonstrate Working as a leader/a team member.
4. Follow ethical practices.
Minimum Theoretical Background
The pence deriving a new class from an old clas scaled as Inheritance.
Types of Inheritance:
Single Inheritance
Multiple Inheritance
Hierarchical Inheritance
Multilevel inheritance
“sti Sa Board of Fecinical Edsonsaya Programming (22412)
Program Code: Teche,
* a students, TRIBE as
Write a program to ing
x inher
class & Lot mnie, Peta,
‘ cy ae
‘pt 8 : 4
(oid ser x Chaba) me ata.
Sea} Sop ec i aE
g 2 gel Ne Ss, oie i
Vacr ;
8 emit @ obdencitie Vay Ee "8S;
oe : oa Xs
mEY? ;
usr seby Cintey fea ee me 3
yeas Oe ow Aes Cer?
r Cc SEbo 8] oy»
hase CRI CAMA CY SEE 04
§ > Sem C807,
frre
2 Ch ks ptay oy
Lard get 2atnta) 2 : é
2a} e
$ : |
3
MalangProgramming (22412)
oy
level inheritance. name
Xin, ae Se ee Tutte cael vi
2 Deena Heulate ng ond
* Slag eae ee
of single ji \erit
\
(Space for answer)
fon
‘STs Basda aTava Huang ANE)
hav aalive Hate Hoard of Tochilonl Palvontionfor implementation of multiny
‘i : Develop a program
Practical No. 19¢ Develop # program’
1
. eancet A
Deriving ew elo for motile sop
inheritance. Java doesn’t allow multiple inher
the overriding methods of the classes. Interface
in java,
s/parent classes is known as ml
tance to avoid the ambiguity eq
is used to achieve multiple inher
mes (POS)
Releane Program Outer aati, lesan
cengincering to solve the computer group related problems.
'* Discipline knowledge: Apply Computer Programming knowledge to solve i
computer group related problems.
+ Experiment and practic: Plan to perform experiments and practices to ute h
results to solve the computer group related problems.
‘+ Engineering tools: Apply relevant Computer programming technologies
tools with an understanding ofthe limitations.
* Individual and team work: Function effectively as a leader and team member in
diverse/multidisciplinary teams,
* Communication: Communicate effectively in oral and written form.
IM. — Competeney and Practical skills
“Develop Applications using Java.”
‘The Practical is expected to develop the following skills;
1. Write a program to define and extend the interfaces,
2. Develop a program to implement various forms of interfaces.
IV. _ Relevant Course Outcome(s)
Apply concept of inheritance for code reusability,
v. Practical Outcome (PrOs)
Develop a program for implementation of multiple inheritance,
VL Relevant Affective domain related Oute
1, Follow Safety Practices aca)
2. Practice good housekeeping
3. Demonstrate Working as a leader/a te
4. Follow ethical practices. ee
‘VI. Minimum Theoretical Background
1. Interfaces
Java does not support multiple inher
Classes in java cannot have more than
A large number of real-time
mee,ates
a
7 Sepang
state the use of
fe: Attach the code mettasg to
note:
te Do /
Bra
; Hate,
She eng ™Plemen. the Oe iy
fn fr foce Spor, “
: Mee,
4
fot RJ
a, String, Fore,
int a,
pesth Cine
See Caybier4) |
oa
Sait Spot eael
Fetot zpnrytMz}
: ’ IM Ep
a a tM C54 tase’y For 61);
4 buen a 2 at
4 x aspey
Hepatic prty A rreme st teal]
Tote "+
PRIETOJava Progress ODN) es
1, Result (Output of Cod
KIL Practical Related Questions
Note: Below given are few sample questions fOr reference, Teacher Must design
‘more such questions so as (0 ensHre the achievement of identified CO,
reon Cass and faterface-
1. Differentiate beter
Write similarities between interfaces and classes.
2.
3, Write advantages of interfaces.
4. Will this code corapile: ‘successfullyi(ssume Saitable Class)
public interface Farnoust.ine
{ 7
void ShowLinel )
{
Se out.printin(*Show Line"
(Space for answer)
Galtfateo) tashagAmmon Meron oh
5 Signifi
Seal
Meg In Prehan,
inter, ‘ Porting or Mckany hh
aa Sioa Ts clap "neh help ro
ool
Boner oman
@0s)
2. led
evant piachae ei
“ bas
mE ?
a
in package:
ret tient
Omtcome Os
. Teas mtcome
Deveieg
e(s)
tcomas
in related Out
ive domai
fective e
age Ati Diecast
eet 3
B008
aes pckage
i aefined
8 ed
tere
int
of chases, Intert
; Mis ae Doan
is
A siz ia two
Mextion rized
Stole re categor:
Yetage, ahcg
‘Accessing a Package
‘Ajava system patkage can be ~
[sfermy soe PE
Program Code: Teacher,
4 students. hast assign as
e Prem,
Voie a program to, Statement
Note: Attach ZPPIRE N
‘ote: Fa ete atthe ena, eave baste atimated shi, 4
MAREK Apptet y
XT Jaren Bek ge
eb rl Cars aes oreate aéjecy operate
eon Leste. eet FRENEL &)
aug .
See eifese Baesage sles, ere’ :
3. ee! erlor color resigns
¢ ferCatia og -FEOTT tee)
es Saveneepee Oxcepe ten)
edege
>: Sateh SRS Capherd))
NER SN ORBRES
us varastt bn
————— Ee: _—“—"—e
‘Wiaharashira State Board of Technical Edscationee Progamming gna)
xn,
Procttoa Rotated Quest
Notes Hetow given ane
‘more such questions
1. bi stints on
or
sample questions for refironce, Yauchar
Movement af Mentified C0,
vt apple vinyrer anh ITAL, fy
mhpes vAth Aiferent elon
MON dentyy,
sina Parana _XML, Hoxerelae (Any two)
Dovel
3
122 ORION Lo draw a polygon,
‘Develop an applet for diwwing's rumen face,
Write the output of the progeny
import java.aw
import jay; applet
r
%
‘Spite code="Arew™ widtve$00 Heigheeso0>
npplet>
U
‘ublic class Arcs extends Applet iL
( yf fa
public void paint(Graphics gy
4
f.drawAre(10,40,10,70,0,75),
E.fMlAre(100,40,70,70,0,75} 7;
met Arett0. 16070800075),
AiMMAre(100,100,70,90,0,
etrwarec2o0b Abas
{Space for answer)
Techaveat Vawean
TFafta: tee phy LOCF! beplth
. ae
pb ee UL Fat abe
et eh 20, 20 Les OR
bot ahs
tee eT) 24 fen tag,
Gob we Tl = 0 tee 20? Ee Gee
Bos: %
es ai pale CGttGihn 43
6 dee peg Co Mpeg
4 hi gel’ 2/424 TIA
Lae eXXIV, Refereoces! Suggestions for Further Reading
1. Bepe//orarw javatpoint com!
2) kages.iijavaproglane blogspot.com/2014/03/java-graphics-
i WOsRDdlzbIU
5. Proprarnmning with Jave-A Primer by E Balogurusamy
Bese Baa of Toca Bacaticnee See
0
Practical No. 30: Develop a program to draw following sh a
and applets. Apes, rapa,
a) Cone “
b) Cylinders
¢) Cube
d) Square Inside a circle
e) Circle inside a square
L Practical Significance:
The Graphics class of java provides methods for drawing many ditt.
shapes. Students will be able to use different methods of STAPhics prom OPS of
draw cube, cylinders, cones, figures of different shapes, images and texp @ 8 ty
fouts and styles with different appearances of colors. 19 ditterees
Tl. Relevant Program Outcomes (POs)
* . Basic knowledge: Apply knowledge of basic mathematics, sciences and gaa:
engineering to solve the computer group related problems. Basie
* Discipline knowledge: Apply Computer Programming knowledge tp solve
‘computer group related problems. the
* Experiments and practice: Plan to perform experiments and practices oud
results to solve the computer group related problems.
* Engineering tools: Apply relevant Computer programming technologies ang
tools with an understanding of the limitations.
* Individual and team work: Function effectively as a leader and team member in
diverse/multidisciplinary tears.
* Communication: Communicate effectively in oral and written form,
TL Competency and Practical skills
“Develop Applications using Java.”
The practical is expected to develop the following skill
1. Write programs by using different methods of graphics class.
2. Develop applet programs using graphies programming,
IV. _ Relevant Course Outcome(s)
Develop program using graphics and Applet.
V. Practical Outcome (PrOs)
Develop a program to draw following shapes, graphics and applets,
1. Cone
2. Cylinders
3. Cube
4. Square Inside a circle
5. Circle inside a square
VI. Relevant Affective domain related Outcome(s)
1. Follow Safety Practices
2. Practice good housekeeping
3. Demonstrate Working as a leader/a team member.
4. Follow ethical practices.
Uaharashira State Board of Technical EducationQh ——
ai speoretical Bachan ‘oud
aya va getaphiont Lovage tnstde tl
a appret draw grap Bt Jo (hve puis atiig thie gai 4 ,
ae econ shapes, appropriate gtaphtes method willy {HipeE mei la
ws
yest ceS required (Additional)
eso
,
nil
resources used (Additional)
ka
Nameot [Veoae ant
| Ronee | Broad Speciation [uy | Haruna
|S atta oe ce tay)...
jects mele nn bese
Program Code: Teach; sata
: gram Co Je: Teacher must assign a separate prograt statement 0 group af Je
cylinders ete.
Demonstrate the use of basic applet, whieh includes difforent shaper fike cote, ihe,
Note: Attach the code at the end,
QMyIOTr Vara. girth. se + %
Topork «fora oust Pitenfew » ;
Peblic eters epecteal figumed dated frame
pablre speetal figure cs
(avisane sf xem rate Ctrgpecrteed ‘es feers ("Dj
Set size Cuoco feo
Set usibte Carnes
Pubute terd point Cqrap hier) ).
a 9. dravlire Cru, Coy coer $89;
: 9 votre cured C50, 26, 50,200 97
9+ ares ouad C so, %0,100, 565i
+ dorms rect C50, 245 plete, loo)?
Q eras line C50/225,24°/ 240);
9 amos oul C50, 378,407 Od?
F osumes
nes Prat fegureOet
23.
‘Watarashira State Board of Fechnical Bascation ~