• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

constructor and objects .Basic issue

 
Ranch Hand
Posts: 222
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Sheriff
Posts: 7125
184
Eclipse IDE Postgres Database VI Editor Chrome Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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():
 
I suggest huckleberry pie. But the only thing on the gluten free menu is this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic