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
zysi [14]
3 years ago
7

Create an application named TurningDemo that creates instances of four classes: Page, Corner, Pancake, and Leaf. Create an inter

face named ITurnable that contains a single method named Turn(). The classes named Page, Corner, Pancake, and Leaf implement ITurnable.
Computers and Technology
1 answer:
pickupchik [31]3 years ago
4 0

Answer:

1) TurningDemo

public class TurningDemo

{   public static void main(String[] args)

 {      

    Leaf obj1 = new Leaf();

    Corner obj2= new Corner();

    Page obj3= new Page();

    Pancake obj4= new Pancake();

 } }

2) ITurnable

public interface ITurnable

{

 public void Turn();

}

3) Leaf class:

public class Leaf implements ITurnable

{

}

Page class:

public class Page implements ITurnable

{

}

Corner class:

public class Corner implements ITurnable

{

}

Pancake class:

public class Pancake implements ITurnable

{

}

Explanation:

The first is TurningDemo application which creates instance obj1, obj2, obj4 and obj4 of four classes Page, Corner, Pancake, and Leaf. new keyword is used to create new object or instance of each class.

The second is ITurnable interface. It contains a single method Turn() which is of type public.

Thirdly, classes named Page, Corner, Pancake, and Leaf implement ITurnable. implements keyword is used to implement a interface so this interface can be used by these classes.

These classes can also implement turn() of ITurnable interface as follows:

Leaf class:

public class Leaf implements ITurnable

{  public void turn()

 {

 }

}

Page class:

public class Page implements ITurnable

{

public void turn()

 {

 }

}

Corner class:

public class Corner implements ITurnable

{ public void turn()

 {

 }

}

Pancake class:

public class Pancake implements ITurnable

{   public void turn()

 {

 }

}

You might be interested in
Bushman and bonacci (2004) found that prejudiced participants were ____ likely to return a lost e-mail that had been addressed t
LenaWriter [7]
Prejudiced participants were less likely to return the lost email
8 0
3 years ago
Which of the following is a full selector?
Romashka-Z-Leto [24]

Answer:

need picture i have to see picture

Explanation:

3 0
3 years ago
Which property of a text element controls how the browser handles text that does not fit within the element box?
BaLLatris [955]
Margin because it is always on the end of document
6 0
4 years ago
Able to make a survey form using VB (Visual basics 6.0) to represent ways of conservation of
Nadusha1986 [10]
40 is the right answer
6 0
3 years ago
Read 2 more answers
The purpose of multivariate analysis in index construction is to discover the simultaneous interaction of the items to determine
pychu [463]

Answer:

The answer is TRUE. It is a TRUE statement.

Explanation:

Multivariate analysis is the analysis of simultaneous interactions between several variables. If two items are very correlated, they could all be included in the same index.

7 0
3 years ago
Other questions:
  • Heatsinks used to protect cpus in computers from overheating, are shaped so that their surface area is very large. why is that?
    5·1 answer
  • Define the missing function. licenseNum is created as: (100000 * customID) + licenseYear. Sample output:
    10·2 answers
  • 6. Write a program that can multiply an n x m matrix and m x n matrix together: The input specifications are these: Read n and m
    11·1 answer
  • If after a run of arc consistency during the backtracking search we end up with the filtered domains of *all* of the not yet ass
    12·1 answer
  • Select the correct answer.
    13·1 answer
  • Audio editing software contains several codecs that allow you to
    15·1 answer
  • Consider a channel that can lose packets but has a maximum delay that is known. Modify Protocol rdt2.1 to include sender timeout
    11·1 answer
  • Write a calculate_sq_inches_of_good_pizza function that accepts the diameter of a pizza and returns the area of the pizza minus
    7·1 answer
  • The first page of a website is what?​
    5·2 answers
  • How will you maintain electrical tools and equipment?
    12·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!