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

Help and support on OCA OCP Java Programmer Certification Questions
1Z0-808, 1Z0-809, 1Z0-815, 1Z0-816, 1Z0-817

Moderator: admin

Post Reply
clayDustin
Posts: 2
Joined: Tue Jun 03, 2014 9:30 am
Contact:

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

Post by clayDustin »

Hello,

Given:

//Insert code here

public abstract void draw();
}


//Insert code here
public void draw(){ System.out.println("in draw..."); }
}
Which of the following lines of code can be used to complete the above code?

--I thought if an class contained abstract methods it was automatically represented as an abstract class so that in the case of the first option:

class Shape {

and

class Circle extends Shape {

--class Shape would become an abstract method. Thanks

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

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

Post by admin »

I am not sure what you mean by, "class Shape would become an abstract method.". A class cannot become a method.

If a class has an abstract method, it must be declared as abstract.

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

clayDustin
Posts: 2
Joined: Tue Jun 03, 2014 9:30 am
Contact:

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

Post by clayDustin »

admin wrote:I am not sure what you mean by, "class Shape would become an abstract method.". A class cannot become a method.

If a class has an abstract method, it must be declared as abstract.

HTH,
Paul.
Sorry you're right. Wouldn't class Shape become an abstract class?

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

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

Post by admin »

clayDustin wrote:
admin wrote:I am not sure what you mean by, "class Shape would become an abstract method.". A class cannot become a method.

If a class has an abstract method, it must be declared as abstract.

HTH,
Paul.
Sorry you're right. Wouldn't class Shape become an abstract class?
Yes, but you still have to put abstract keyword in the class declaration to make it compile.
If you like our products and services, please help us by posting your review here.

OCAJO1
Posts: 221
Joined: Mon Nov 26, 2018 2:43 pm
Contact:

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

Post by OCAJO1 »

General Question: How indicative of the real test is/was this last day test? Thanks

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

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

Post by admin »

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

flex567
Posts: 202
Joined: Mon Apr 02, 2018 8:40 am
Contact:

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

Post by flex567 »

Had this been an option would it be correct:

Code: Select all

public abstract class Shape {  
and  
public class Circle  extends Shape {
and also this one:

Code: Select all

abstract class Shape {  
and  
class Circle  extends Shape {

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

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

Post by admin »

1. Yes.
2. Yes.
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 21 guests