About Question enthuware.ocajp.i.v7.2.892 :

All the posts and topics that contain only an error report will be moved here after the error is corrected. This is to ensure that when users view a question in ETS Viewer, the "Discuss" button will not indicate the presence of a discussion that adds no value to the question.

Moderators: Site Manager, fjwalraven

Post Reply
gliesian
Posts: 9
Joined: Sun Oct 28, 2012 8:17 pm
Contact:

About Question enthuware.ocajp.i.v7.2.892 :

Post by gliesian »

As they are listed, all of the following classes have a warning in NetBeans:

ImaginaryNumber is not abstract and does not override abstract method doubleValue() in Number:

Code: Select all

public class ImaginaryNumber extends Number { }
No suitable constructor found for boolean:

Code: Select all

public class ThreeWayBoolean extends Boolean { }
System has private access in System:

Code: Select all

public class NewSystem extends System { }
Cannot inherit from final String:

Code: Select all

public class ReverseString extends String { }
Thanks,
Robert

admin
Site Admin
Posts: 10046
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: About Question enthuware.ocajp.i.v7.2.892 :

Post by admin »

I am not sure what is your point here. These are not the right options.

HTH,
Paul.
If you like our products and services, please help us by posting your review here.

admin
Site Admin
Posts: 10046
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: About Question enthuware.ocajp.i.v7.2.892 :

Post by admin »

BTW, as a general rule, what netbeans shows in the IDE is not as important as what the compiler shows when you try to compile a piece of code. (From the exam perspective)

HTH,
Paul.
If you like our products and services, please help us by posting your review here.

boonnick
Posts: 9
Joined: Fri Jan 31, 2014 8:26 pm
Contact:

Re: About Question enthuware.ocajp.i.v7.2.892 :

Post by boonnick »

I tried to compile

public class ImaginaryNumber extends Number { }

on the command line.

C:\Users\Nick\Desktop>javac ImaginaryNumber.java
ImaginaryNumber.java:1: error: ImaginaryNumber is not abstract and does not over
ride abstract method doubleValue() in Number
public class ImaginaryNumber extends Number { }
^
1 error

C:\Users\Nick\Desktop>

If it doesn't compile, is it a valid class?

admin
Site Admin
Posts: 10046
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: About Question enthuware.ocajp.i.v7.2.892 :

Post by admin »

You are right. The code has been updated to indicate that it contains implementation for abstract methods of the base class.
thank you for your feedback!
If you like our products and services, please help us by posting your review here.

Post Reply

Who is online

Users browsing this forum: No registered users and 28 guests