1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
gtnhenbr [62]
2 years ago
15

Which of the following class definition defines a legal abstract class Group of answer choices public class Rectangle abstract {

public abstract double findArea ( ); } public abstract class Rectangle { public abstract double findArea ( ); } public class Rectangle { public abstract double findArea ( ); } public class abstract Rectangle { public abstract double findArea ( ); }
Computers and Technology
1 answer:
valkas [14]2 years ago
7 0
<h2>Question</h2>

Which of the following class definition defines a legal abstract class Group of answer choices

(a)

public class Rectangle abstract {

   public abstract double findArea ( );

   

}

(b)

public abstract class Rectangle {

   public abstract double findArea ( );

   

}

(c)

public class Rectangle {

   public abstract double findArea ( );

   

}

(d)

public class abstract Rectangle {

   public abstract double findArea ( );

   

}

<h2>Answer:</h2>

(b)

public abstract class Rectangle {

   public abstract double findArea ( );

}

<h2>Explanation:</h2>

When a class is declared with the abstract keyword, the class is called an abstract class. Abstract classes cannot be instantiated and may include one or more abstract methods. If a class contains an abstract method, then it (the class) must be declared abstract.

In Java, abstract classes are defined using the following format:

<em>[access_modifier]</em> abstract class <em>[name_of_class]</em>

[access_modifier] specifies the access modifier of the class which could be public, private, e.t.c

abstract is the keyword that specifies that the class is an abstract class.

class is a keyword used for defining classes

name_of_class specifies the name of the class.

The only option that fulfils this format is <em>option b</em> where;

(i) The access modifier is public

(ii) The name of the class is Rectangle

Option a is not correct because the <em>abstract</em> keyword is supposed to come before the <em>class</em> keyword.

Option c is not correct because the keyword <em>abstract</em> is missing. In other words, the class must be declared abstract since it contains abstract method findArea();

Option d is not correct because the <em>abstract</em> keyword is supposed to come before the <em>class</em> keyword.

You might be interested in
Why is printer an output device​
Vitek1552 [10]

printer is an output device because,

A printer is a device that accepts text and graphic output from a computer and transfers the information to paper, usually to standard size sheets of paper.

So, a printer is an external hardware output device that takes the electronic data stored on a computer or other device and generates a hard copy of it.

therefore, it can be said that a printer is an output device

7 0
3 years ago
Read 2 more answers
Which protocol can be used to send ipv6 packets over an ipv4 network?
Mariana [72]
There are three tunneling protocols. They are ISATAP, <span>teredo and 6TO4</span><span />
4 0
2 years ago
Write an algorithm to find perimeter of circle<br>​
Anna11 [10]

Answer:

Here’s one!

Given [math]R[/math], the radius of the circle.

Let [math]N,D\leftarrow 0[/math]

Repeat until [math]D[/math] is large enough (about 1,000,000)

[math]x,y\leftarrow U[0,1][/math]

If [math]x^2 + y^2\le 1[/math] then [math]N\leftarrow N+1[/math]

[math]D\leftarrow D+1[/math]

[math]P\leftarrow\frac{8NR}{D}[/math]

Return [math]P[/math]

[math]U[0,1][/math] is a uniform random number in the range [math][0,1][/math].

Explanation:

6 0
2 years ago
7. Little Big Planet advanced the platforming genre of games by __________.
patriot [66]

Answer:

Explanation:

c because it will hook the person

5 0
3 years ago
Are brake and break pronounced the same way?​
erastova [34]

Answer:

one is correct and yes

Explanation:

4 0
3 years ago
Other questions:
  • Where does the VLookup function find its lookup values?
    14·1 answer
  • Write a program that prints the U.S. presidential election years from 1792 to present day, knowing that such elections occur eve
    9·1 answer
  • A subroutine may be used to refer to which of the following? Check all that apply.
    15·2 answers
  • What in the world is this for and how do you use it
    8·2 answers
  • Which of the following statements is true of San serif fonts?
    12·2 answers
  • A programmer wants to determine whether a score is within 10 points of a given target. For example, if the target is 50, then th
    11·1 answer
  • What does an arrow after a command indicate
    13·2 answers
  • Aii so is anyone pushing P?<br> if u are u a g
    8·2 answers
  • I will give brainyest
    15·2 answers
  • Explain why you would use the soft on/off jumper when working on ATX system
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!