I was asked to draw the class diagram for the below
scenario which should obey OOPS concept. A Portal is to be
developed for a school , which has 3 main divisions viz ,
Education , Admin & Trust. Each division has 2 sub
divisions Kinder Garden & Higer Secondary.

Answers were Sorted based on User's Feedback



I was asked to draw the class diagram for the below scenario which should obey OOPS concept. A Por..

Answer / guest

I said , I will have a Base Class School , and 3 sub
classes for school , viz Admin Class, Eucation Class &
Trust Class. I will have an interface with 2 methods , viz
KinderGarden() and Hsc() and an implementation class for
these methods. The sub classes will extend School class and
implement this interface.

Is This Answer Correct ?    26 Yes 2 No

I was asked to draw the class diagram for the below scenario which should obey OOPS concept. A Por..

Answer / adarsh

I think the best way to do this would be to have an interface for school,Kinder Garden and Higher secondary .Make School as the super class and kinder garden and secondary as an interface which extends the school interface.Then we can have three classes Education,Admin and Trust and make this classes implement both kinder garden and Secondary interfaces

Is This Answer Correct ?    1 Yes 0 No

I was asked to draw the class diagram for the below scenario which should obey OOPS concept. A Por..

Answer / binoy

I would answer this different.

I would have a Class (Interface) called School.
I will have an Class (Interface) called Division extending
School.
Education , Admin and Trust would be instances of Division.
KinderGarten and Higher Secondary would be subclasses that
would implement the Division interface.
In real time scenario, KinderGarten or Higher secondary
would be implementing either Education,Admin or Trust
classes.


I am not sure if any of them are any methodes. All are to
be considered as classes instead of methods

Is This Answer Correct ?    3 Yes 3 No

Post New Answer

More Core Java Interview Questions

3) Suppose you are a very rich person, having 50 rooms and you have lost the key for one of the room's. How effectively you can find this key? (Qs2 and Qs3 are related)

3 Answers   RBS,


If I will write String s=new String("XYZ"); String s1=new String("XYZ"); if(s.equals(s1)){ sop("True"); } else{ sop("False"); } This program will give me "True". But When I am creating my own class suppose class Employee{ public Employee(String name); } Employee e= new Employee("XYZ"); Employee e1 = neew Employee("XYZ"); if(e.equals(e1)){ sop("True"); } else{ sop("False"); } Then it will give the output as "False". Can I know what is happening internally?

5 Answers  


What are access specifiers available in java?

0 Answers  


Differentiate between a class and an object.

0 Answers  


What is string [] args?

0 Answers  






What primitive Java types? Howmany are they and what are their names?

3 Answers  


Why is boolean important?

0 Answers  


How do I find and replace in word?

0 Answers  


what is meant by HQL?

0 Answers   Cap Gemini,


Which is faster string or stringbuilder?

0 Answers  


can we have virtual functions in java?

11 Answers   Wipro,


How do you insert a line break?

0 Answers  


Categories