• Post Reply Bookmark Topic Watch Topic
  • New Topic

Java Questions  RSS feed

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey Everyone,

I have a few questions that I'm not quite sure on. I did a little research and still can't find exactly what I'm looking for.

1. "A SchoolBus is a bus and since it is a Bus, it is also a vehicle." This Object Oriented Principle is this?
2. Overloading and Overriding represent which OOP principal?
3. Making instance variables private but methods public demonstrates the OOP principal of?

Thanks.

 
Author and ninkuma
Marshal
Posts: 66307
152
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What are your answers? Post them and we'll weigh in on what we think about them.
 
John Jacksons
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Accidentally submitted two responses. See my reply below!
 
John Jacksons
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, as for #1, I am really not sure.
As for #2, I think Inheritance?
And As for #3, I would think Modularity?

Sorry for my ignorance, I'm very new to java. Thank you again.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66307
152
IntelliJ IDE Java jQuery Mac Mac OS X
  • Likes 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For #1, this property allows an "is a" relationship. Another example is a Dog is an Animal which is a LivingThing which is an Object. Does that help?

For #2, these features allow one thing to take on more than one form. So what would the OO principle be?

For #3, data hiding, it's a good thing. It allows object to have cohesion and to enclose its workings. Help?
 
John Jacksons
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks -- but for #2, I still think Inheritance? In the book I'm reading, I just finished up Inheritance -- so I'm still stuck. Thank you again.
 
Bartender
Posts: 2087
44
Firefox Browser IntelliJ IDE Java Linux Spring
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As for #2 (a quote) these features allow one thing to take on more than one form.
More than one form is many forms.
Think about Greek. Many forms...
 
John Jacksons
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Polymorphism?
 
Marshal
Posts: 56600
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think the correct answer to Q2 is



None.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!