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
On a printed circuit board, electronic components will be mounted from the
Likurg_2 [28]
On a printed circuit board, electronic parts will be mounted from the substrate side of the board. The leads jab through the substrate and the copper sheeting that has been carved. The leads are then soldered to the copper.

I hope the answer will help you. 
3 0
2 years ago
In the line of code shape ("classic") which part of the code is the argument
Mekhanik [1.2K]
Whatever is in the parenthese
5 0
3 years ago
Read 2 more answers
Using positive self talk is a great way to
lora16 [44]
Boost your self esteem and confidence.
7 0
2 years ago
Read 2 more answers
Which group on the Home Ribbon allows you to add shapes to a PowerPoint slide?
skad [1K]
It is under the drawings group.  
8 0
3 years ago
Read 2 more answers
Which of the following is NOT essential for individuals to have to build their own web page?
natali 33 [55]
Linux. You do not need Linux as an operating system for your website.
5 0
3 years ago
Other questions:
  • _____ are the supertiny on-off switches in a chip that work collectively to calculate or store things in memory. Transistors Mul
    10·1 answer
  • An expression that has correctly paired delimiters is called a(n)
    6·1 answer
  • . Why should we favor programming to interfaces over implementations?
    6·1 answer
  • Nonprogrammed decision
    7·1 answer
  • Hey, how is everyone????????????????????????????????
    8·2 answers
  • Most of the Desktop games contain a backdoor used to test and update the game.
    14·1 answer
  • The graphic shows a cause and effect organizational aid.
    6·1 answer
  • Modern Computers compared to earlier computers are
    10·1 answer
  • I really need help in this!!!
    11·1 answer
  • Check all that apply to Raster Graphics
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!