This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds and have James Denton on-line!
See this thread for details.
Win a copy of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds this week in the Cloud/Virtualization forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

subClass methods ?  RSS feed

 
Ranch Hand
Posts: 5390
1
Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
here is a Que from Maha's mock test
33. Consider the classes defined below:

Which of the following are legal method declarations to add to the class Sub? Assume that each method is the only one being added.
a) public static void main( String args[] ){}
b) float methodTwo(){}
c) long methodOne( int c, long d ){}
d) int methodOne( int c, long d ) throws ArithmeticException{}
e) int methodOne( int c, long d ) throws FileNotFoundException{}
I think answer is
a) as it is our pet main() method
b) as it is overloading super class's method
d) as it is throwing unchecked Exception and I checked it it compiles fine.
e) as FileNotFoundException is subClasss of IOE.
AND
c) can not be as return type is different.
but evalution page says that ans is WRONG.. and page which contains answer is not available.
so plz ane1 can tell what is the answer for the above question
CMIW
TIA
 
Ranch Hand
Posts: 732
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
lets leave this one for Valentin or Rob to answer but im with u Kumar on this one .
c is wrong the rest are correct in my opinion.
 
Gold Digger
Sheriff
Posts: 7610
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How kind of you Roy
You got the right answers...
Anyone else?
 
R K Singh
Ranch Hand
Posts: 5390
1
Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Valentin Crettaz:

You got the right answers...


Hi Val
then why it is giving WRONG
coz my other que, also I was thinking that answer might be wrong(Errata) but after discussing here I found that I was wrong.... Though I still say that above given ans is correct in my knowledge but then WHY it is giving "WRONG"???
TIA
 
Valentin Crettaz
Gold Digger
Sheriff
Posts: 7610
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It says WRONG because because you don't have all right answers. Let's say correct answers are a, b and c. If you don't answer that, then the verdict will be WRONG, that is even if you answer a,b,c,d you'll get wrong...
Now from what I see in the HTML page source code, the correct answers are a,b and e. So I don't know why she doesn't count d as a correct option...
Anyone else ?
 
R K Singh
Ranch Hand
Posts: 5390
1
Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
so we can assume it to be error ... what ever Typo, etc....
so ans is a b d e
CMIW
Thanks
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!