• Post Reply Bookmark Topic Watch Topic
  • New Topic

constructor and objects .Basic issue  RSS feed

 
ekte spiriopoulos
Ranch Hand
Posts: 217
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello, when i create a constructor of a class i created for one purpose to use it for objects? What i mean is hat i create lets say the objects (i am lets say in one class dog) and when i want to go to have access to another class(lets say this class is superclass and named of class is Animals) then the constructor i have on the class Animals is used for the objects i created on the class dog?This is my first question.
Second question what else does the constructor .I create both constructor ( i mean default - and full constructor) but generaly i dont know what else do except of that i refer on the question one.
 
Knute Snortum
Sheriff
Posts: 4087
112
Chrome Eclipse IDE Java Postgres Database VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What i mean is hat i create lets say the objects (i am lets say in one class dog) and when i want to go to have access to another class(lets say this class is superclass and named of class is Animals) then the constructor i have on the class Animals is used for the objects i created on the class dog?

To access the superclass's constructor from a subclass, use the keyword super():
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!