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
statuscvo [17]
3 years ago
8

Given the following class: Create a class MyGenerator that can be used in the below main method.

Computers and Technology
1 answer:
natali 33 [55]3 years ago
4 0

Answer:

Explanation:

The below code shows the complete code for the project. we have used Math.random() as a means of generating a random double value in the getRandom() method since it is not specified.

class Random {

          \ \ \ \ \ \ \ \ \mathbf{  public  \ static \  void  \ main \ (String[] \  args) \ \   \{}

               perform(new MyGenerator());

       }  

           \mathbf{private  \ static \  abstract  \ class  \ Generator \{ \ }

                  \mathbf{ \ protected  \ abstract  \ double \  getRandom();}

       }  

       public static <T extends Generator> void perform(T g) {

               \mathbf{System.out.println(g.getRandom());}

       }  

       // MyGenerator class inherited from Generator

       public static class MyGenerator extends Generator {

               // implementing abstract method getRandom() of Generator class

               \mathbf{Override}

               \mathbf{protected \  double  \ getRandom() \{ }

                       //returning a single double value between 0.0 and 1.0

                       \mathbf{return \ Math.random();}

               }

       }

}

/*OUTPUT (will be random)*/

0.53296649765

You might be interested in
HURRY!!!!!!
katen-ka-za [31]

Answer:

pose to pose r

Explanation:

4 0
3 years ago
17. Which of the following is not a visible section in a File Explorer window?
andrew-mc [135]

Answer: D.)

Explanation: Clipboard

4 0
3 years ago
What is the system of computers, routers, wires, cables,etc. that allow computers to communicate called?
Anika [276]
Internet maybe?
Not 100% sure though
5 0
3 years ago
You use a(n) ____ program to create, send, receive, forward, store, print, and delete e-mail messages.
tigry1 [53]

Answer:

B - E-Mail

Explanation:

This is a program to create, send, receive, forward, store, print, and delete e-mail messages.

3 0
3 years ago
In MS Excel, a function is written as =FUNCTION_NAME(_____________________).​
otez555 [7]

Explanation:

A function is a predefined formula that performs calculations using specific values in a particular order. All spreadsheet programs include common functions that can be used for quickly finding the sum, average, count, maximum value, and minimum value for a range of cells. In order to use functions correctly, you'll need to understand the different parts of a function and how to create arguments to calculate values and cell references.

6 0
3 years ago
Other questions:
  • Look at the following array definition:
    11·1 answer
  • Which are examples of copyrighted online materials? Check all that apply.
    14·2 answers
  • Interactive media professionals are unique among other Information Technology professionals because they
    7·1 answer
  • A​ __________ is a commonly used tool for showing how the parts of a whole are distributed.
    11·1 answer
  • As the project manager for a software development project, you are helping to develop the project schedule. You decide that writ
    13·1 answer
  • What is an efficient way to ensure that the code is working as per the acceptance criteria/business requirements? (1 correct ans
    11·2 answers
  • When all RGB colors have the same value, the resulting color will most likely be some variation of _______________.
    11·1 answer
  • Please help!! I dont need the answer i just need explaining on how to do this!!!!
    9·1 answer
  • What ethical concerns might arise from applying new IT to law enforcement?
    5·1 answer
  • The lost boy gave the correct
    10·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!