aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Exam Lab Question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Exam Lab Question" Watch "Exam Lab Question" New topic
Author

Exam Lab Question

Duran Harris
Ranch Hand

Joined: Nov 09, 2008
Posts: 598

Question 20 from Devakas Exam Lab(Practice Exam 3 I think)



This is really confusing me because I can't figure out which method to implement..
Any tips?


===>SCJP 1.5(72%)<===
==>SCWCD1.5(76%)<===
Ruben Soto
Ranch Hand

Joined: Dec 16, 2008
Posts: 1032
A concrete class can't have abstract methods, so it must implement all the abstract methods from its ancestors. You need to implement both BuildNow() and buildNow() (I'm guessing these are two different methods and not a typo.)


All code in my posts, unless a source is explicitly mentioned, is my own.
Punit Singh
Ranch Hand

Joined: Oct 16, 2008
Posts: 952
It's a typo Ruben.

You need to implement only UDI method.



As Nonc is extend UDI, and UDI is already implemented Buildable buildNow() as Abstract, you have to satisfy only UDI's buildNow() method.


SCJP 6
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14351
    
  22

Please use code tags when you post source code.


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
Duran Harris
Ranch Hand

Joined: Nov 09, 2008
Posts: 598

Yes it was a typo.

But UDI has not implemented the interfaces methods..It has declared the method as abstract.So it is up to Nonc to implement UDI's buildNow method as well as Buildables buildNow method.But how can it do this?
Ruben Soto
Ranch Hand

Joined: Dec 16, 2008
Posts: 1032
There is only one method. The abstract class is "overriding" the interface method.
Punit Singh
Ranch Hand

Joined: Oct 16, 2008
Posts: 952
Duran, Nonc cannot see now Buildable method, as it has been declared as abstract by its implementor class UDI.
Duran Harris
Ranch Hand

Joined: Nov 09, 2008
Posts: 598

Is IllegalThreadStateException a runtime exception?
Punit Singh
Ranch Hand

Joined: Oct 16, 2008
Posts: 952
Yes Duran, and your exam is on Friday, just open K&B 6 book, go to chapter 5 page 382 Table 5-2, here all runtime exceptions are given, also which are thrown by JVM and which are by Programmer, mug up this, make a small diary or note, write down this as a small quiz, it will help you in last hours before your exam.

Make all such notes, at least to see one time before your exam.
Duran Harris
Ranch Hand

Joined: Nov 09, 2008
Posts: 598

Oh that explains it then...
 
wood burning stoves
 
subject: Exam Lab Question