What is the output of Math.min(3, 4.0)
3.0
Which of the following is the smallest?
A. 203(base 7)
B. 250(base 6)
C. 410(base 5)
D. 10211(base 3)
E. 1220(base 4)
A
What is:
Math.ceil(-2.9)
-2.0
system.out.print ( 20 + 4 )
24
What is the output of:
String str="!@#$%^&*";
str.substring(1);
System.out.println(str);
!@#$%^&*
What is the ASCII of A?
What is the ASCII Of a?
What is the ASCII of 0?
65
97
48
What is stored in num?
int num = 5 & 4 | 3 ^ 2 & 1;
7
When decade was Java Invented?
1990s
What does Int mean
integer….no decimal
What is the bit size of a int?
What is the bit size of a double
32-bits
64-bits
Simplify the following:
A||!(B&&A||A)
True
system.out.print( “aplus” + 1);
aplus1
What does Integer.toString(10, 2) do?
Converts 10 to base 2
int[][] mat = new int[3][3]
for(int r = 0; r < 3; r++)
for(int c = 0; c < 3; c++)
mat[r][c] = r * c + c;
System.out.println(mat[1][0] + mat[2][1]);
5
What sorting algorithim does Java use during Arrays.sort()?
Mergesort
Name all the types of loops in Java that we use
While, For
What is the contents of arr:
ArrayList<Integer> arr = new ArrayList<>();
arr.add(5);
arr.add(0, 3);
arr.add(2);
arr.remove(0);
arr.add(100);
arr.set(3, 0);
Index Out of Bounds Error
System.out.println(r(2));
public int r(int rr) {
if(rr < -5) return -1;
else return rr * -2 + r(rr-7);}
5
What is the 2's complement of -165
mrs states favorite drink
dr pepper