Answer:
The output is "A"
Explanation:
public class Solution {
public static void main(String args[]) {
mystery(7);
}
public static void mystery(int a) { System.out.println("A"); }
public static void mystery(double a) { System.out.println("B"); }
public static void mystery(int a, double b) { System.out.println("C"); }
public static void mystery(double a, int b) { System.out.println("D"); }
}
In the code above; mystery is defined in four different ways called method overloading. Method overloading is when same method is defined with different parameters.
In the first case; mystery will be called if the argument is int.
In the second case; mystery will be called if the argument is double.
In the third case; mystery will be called if the arguments are int and double.
In the fourth case; mystery will be called if the arguments are double and int.
When mystery(7) is called; the mystery method requiring only int will be called and the output is "A".
A paint or art program on your computer.
Given the following word addresses: 3, 180, 43, 2,191, 88, 190, 14, 181, 44, 186, 253
professor190 [17]
Answer:
A. index bits = 2, tag bits = 2, block offset bits = 1, it is a miss.
B. index bits = 2, tag bits = 1, block offset bits = 0, it is a hit
C. the miss rate is 0
Explanation:
a. number of blocks = 12
number of blocks per set = 3
number of set = number of blocks / number of blocks per set = 12/3 = 4
word size = 24
block size = 2
the block offset =
block size
=
2 = 1
the index bits =
number of set =
4 = 2
the tag bits = (
word size) - offset - index = (
24) -2 - 1 = 5 -2 - 1 = 2
b. word size = 8
block size = 1
the block offset =
block size
=
1 = 0
the index bits =
number of set =
4 = 2
the tag bits = (
word size) - offset - index = (
8) -2 - 1 = 3 - 0- 2= 1