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
4. Contoso, Ltd. has a vigorous Office 365 and Azure cloud-service presence.
OverLord2011 [107]

Answer:

Contoso has an on-premises identity infrastructure. The infrastructure includes servers that run Active Directory Domain Services

Explanation:

3 0
2 years ago
QUESTION 5
Zepler [3.9K]

Answer:

allows users to accomplish tasks such as create text documents.

Explanation:

8 0
2 years ago
Write code to complete print_factorial()'s recursive case. sample output if user_val is 5: 5! = 5 * 4 * 3 * 2 * 1 = 120
maxonik [38]
```
#!/usr/local/bin/python3


import sys

def print_factorial( user_val ):
    if( user_val < 1 ):
        return( 1 )
    else:
        return( print_factorial( user_val - 1 ) * user_val )


if( __name__ == "__main__" ):
    if( len( sys.argv ) == 2 ):
        print( print_factorial( int ( sys.argv[ 1 ] ) ) )
    else:
        sys.stderr.write( "usage: %s <integer>\n" % sys.argv[ 0 ] )

    exit( 0 )
```

5 0
3 years ago
How would I collect a number from the user to use for the radius of a circle?
exis [7]

Answer:

C is the correct answer to your question

7 0
2 years ago
What defines "print media"? It is media that includes words and text rather than video, such as many blogs. It is media that is
uranmaximum [27]

Answer:

"It is media that is distributed in paper form, such as magazines and newspapers."

3 0
3 years ago
Other questions:
  • How many questions must you answer in Brainly to be able to message people?
    6·2 answers
  • 7. Which innovation in video games do you think has been most significant? Include at least one way that innovation affects the
    6·1 answer
  • Convert 15 from decimal to binary. Show your work.
    14·1 answer
  • When a formula contains the address of a cell, it is called a(n) ________.
    15·1 answer
  • Explain briefly why every person in the world is not connected to the Internet.
    9·1 answer
  • What is the CPU's role?
    15·2 answers
  • Which of the following is a characteristic of vector graphics?
    15·2 answers
  • The following statements regarding centralized administration concepts are presented to you in an interview in which only one of
    5·1 answer
  • Write a 2 paragraph on an African American who has become successful in IT. Need help asap can’t think of anything
    5·1 answer
  • In which of the following movies, multimedia's special effect is used ? *
    8·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!