Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

lots of "extends" ??

 
sonir shah
Ranch Hand
Posts: 435
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Options :
1) The program will fail to compile
2) Class cast exception at runtime
3)it will print 30,20
4)it will print 30,30
5)it will print 20,20
The output is 3)30,20
Why??
{I edited the post to add the code tag, ersin eser}
[ January 10, 2002: Message edited by: ersin eser ]
 
Rob Ross
Bartender
Posts: 2205
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sonir,
you need to start using the CODE tags before and after your code. Type [ CODE ] without any spaces between the bracket and the word CODE at the begining of your code, then [ /CODE ] at the end of your code, without the spaces. This will make it much much easier to read your code and help you!
 
ersin eser
Ranch Hand
Posts: 1072
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
methods dynamically bind not the instant variables.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic