Home > Back-end >  Pray god to do it
Pray god to do it

Time:09-22


Pray god to do under the

1, the experiment requirements

This experiment: in different singers sing a different song as the background, experience the definition and use of abstract classes

1 to 1. The business description:

1-1.1. Singer is capable of singing collectively,

1-1.2. Specific singer and with different style and type, such as pop, national class;

1-1.3. This experiment to simulate different singers to sing the song as the background, experience the definition and use of abstract classes

1-2. Create a project and configure the environment:

1-2.1. The limit 1. Create a test project, named: SE_JAVA_EXP_E035P;

1-2.2. Limit 2. Create a package, named: cn. Campsg. Java. Experiment;

1-2.3. Limit 3. Create a package, named: cn. Campsg. Java. Experiment. The entity,

1-3. Create a singer is an abstract class:

1-3.1. Limit 1. In cn. Campsg. Java. The experiment, the entity in the package to create an abstract class: AbstractSinger,

1-3.2. For AbstractSinger method of adding "introduce professional class:

1) display content is: "Hello, I am a singer,";

2) the method definition of "introduction to professional requirements are as follows:


Access to

Method name

The return value

The method parameters

Parameter description

Public

Introduce

Void

There is no

There is no

Method statement

His own used to introduce professional,

AbstractSinger for 1-3.3. Add "sing" abstract methods, methods to define requirements are as follows:


Access to

Method name

The return value

The method parameters

Parameter description

Public

Sing

Void

There is no

There is no

Method statement

Singer singing abstract method,

Class 1-4. Create a pop singer,

1-4.1. Limit 1. In cn. Campsg. Java. The experiment, the entity in the package to create pop singer: PopSinger

1-4.2. Make PopSinger AbstractSinger abstract class, the class hierarchy

1-4.3. PopSinger class implement the AbstractSinger defined in the class sing abstract methods, implementation requirements are as follows:

1) to the console output in the method body "I sing pop music,"

1-5. Simulation singer to sing a song:

1-5.1. Limit 1. In cn. Campsg. Java. The experiment in the package to create the main class: MainClass;

1-5.2. For the entrance to the main ways to create MainClass: the main;

1-5.3. In the main, with the pop star class instantiation object of a singer,

1-5.4. In the main, the call object singer introduce method and sing method,

1-5.5. In the console view and verify the output,

CodePudding user response:

No generation of homework!
No generation of homework!
No generation of homework!

CodePudding user response:

reference 1st floor tianfang response:
no generation to do my homework!
No generation of homework!
No generation of homework!

  gnome male -"

CodePudding user response:

reference 1st floor tianfang response:
no generation to do my homework!
No generation of homework!
No generation of homework!

ah

CodePudding user response:

refer to "the other shore flower reply: 3/f
Quote: refer to 1st floor tianfang response:

No generation of homework!
No generation of homework!
No generation of homework!

Oh


No generation of homework!
No generation of homework!
No generation of homework!
  • Related