• 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

problem with scjp 1.5

 
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have been preparing for the exam since nov 2005, but finaly had the k and b book last week, and I am writing on the 15 of march, I have read the book in ten days with all the chapters on a four hours daily rate. I have understand most of the things but I have so many confussing things there, and their questions too are very very scary, well check this out

1) class Sample{
public void me(){//do stuff}
}
class Sample2 extends Sampe{
public void me(){//do sub stuff}
static public void main(String[] h){
Sample f=new Sample2();
f.me()//which me is called
Sample[] mess=new Sample[2];
mess[0]=new Sample();
mess[1]=new Sample2();
for(Sample s : mess){
s.me();//I believe this will do it specificaly
}
//what if I pass new Sample2 into a method that is expecting sample what wil execute
((Sample2)f).passSample(new sample2);//which me will execute
}
void passSample(Sampe s){
s.me();

}
}

finally I dont understand polymophism and how reference type variable defines the methods of called by and object nomatter what it refers to
 
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can always call the Prometric and reschedule to a later date, no extra cost. That will give you more time to study.

Mark
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic