Complete the code to implement a generic class that only acc…
Complete the code to implement a generic class that only accepts objects of types that extend the Number class. You need to: Implement a generic class that accepts only types that are subclasses of Number (such as Integer, Double). Add a method to calculate the average of the two stored values. In the main method, initialize the class with two Integer values and two Double values, and print the average of each pair. // Create a generics class with bounded typesclass GenericsClass { // Variables to hold the data private ___ data1; private ___ data2; // Constructor to initialize both data values public GenericsClass(___ data1, ___ data2) { this.data1 = data1; this.data2 = data2; } // Method to calculate the average of the two stored values public double average() { }} class Main { public static void main(String[] args) { // Initialize the generic class with two Integer values and print the average // Initialize the generic class with two Double values and print the average }}
Read DetailsThere are four (4) parts to this question. Please take your…
There are four (4) parts to this question. Please take your time as you will use your result from Part A as the input to Part B, etc. Please note the following: Your answers must be integers. You must provide the exact answer GB is equivalent to 230 and not “1 billion” (i.e. – 1,073,741,824 bytes) You may assume a 4KB block size You may assume 4-byte addresses All answers are whole numbers – no fractions or decimals Answer these questions: How many data blocks are utilized for a file with 142.10 GB of data? [part_a] How many blocks of direct pointers are necessary to reference the data blocks in part (A)? [part_b] How many blocks of indirect pointers are necessary to reference the direct pointer blocks in part (B)? [part_c] How many blocks of double indirect pointers are necessary to reference the indirect pointer blocks in part (C)? [part_d]
Read Details