Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Assignement 3
1. Department of Computer Science and Engineering
POORNIMA COLLEGE OF ENGINEERING –Jaipur
BTech-CSE(V-Sem)PCE-Jaipur-Rajesthan –India(Vishal Choudhary) Page 1
Assignement-3
Subject: Adv.Java Programming Sub Code: 5CS4-24
1. What isconstructor? Andwhatis the purpose of defaultconstructor. Write aprogram to define
a constructor of class Bankand can calculate the rate of interestalsodisplaythe name of client
inthe mainmethodwiththeirbalance.
2. What isdifference betweenastaticvariable,staticmethodandastatic block?Define astatic
methodboyinclass human. Andprintthe string“I am boy”. Alsodefinethe staticvariable and
staticbock in same class.
3. What isdifference betweenstaticmethodandinstance method?Give anexample of each.
4. What isinheritance .write aprograminwhichclassuniversityisinheritedfromachildclass
studentanda class teacher?Classteacherisalsoinheritedbythe classcourse.Displaythe
relevantinformationineachclass.
5. What isdifference betweenmethodoverloadingand overridinggive anexample of each.
6. What isthe use of SUPER and THIS keyword?Write aprogram in eachcase.
7. What ispolymorphism? Write aprograminjava to show the polymorphism.
8. What isdifference betweenstaticanddynamicbinding.Write aprogramto show static and
dynamicbinding.
9. What isthe use of keywordfinal injava?Show withexampleineachcase.
10. What isrun time polymorphism?Write ajavaprogram to displayruntime polymorphism.
11. Create a class Personwithprivate instance variableforpersonname andbirthdates;add
appropriate accessmethodtothese variables.the create asubclasscollegegraduate with
private instance variable forstudentCGPA and yearof Graduationfor yourclasses.Thencreate
a class withmain() methodthatdemonstrate yourclass.