Q1: Java is Short form for JavaScript
a. True
b. b. False
c. c. Not Applicable
Q2: Which operator is used for addition(adding two numbers)
a. +
b. +1
c. ++
Q3: what keyword is used to return a value inside a method
a. Get
b. Break
c. Return
Q4: according to Java coding convention, which of the following is a correct constant
name?
a. InterestRate.
b. interestRate.
c. INTERREST_RATE.
Q5. If we have the following expression
var1 = ++var2;
and assume the variable var2 contains 5 initially, what value will be assigned to variable var1?
a. 5
b. 6
c. 4
d. 7
e. 3
Q6: Suppose that we have following segment of code: Sytem.out.printf("Number: %5.2f",
5.1345);
The output should be
a. Number: 5
b. Number: 5.13
c. Number: 5.134
d. Number: 5.1345
Q7: All of the following are valid predefined Java Exceptions, Except
a. ArithmeticException
b. RuntimeException
c. DBDException
d. NullPointerException
Q8: In Java, if an array of integer has five elements, select the correct index range
a. 1-5
b. 5-10
c. 1-4
d. 0-4
e. 0-5
Q9: Which index is the last element in an array called nuns at?
A. nums.length
B. Nums.length - 1
Q10: Which of the following declarations will cause a compile time error?
A. int[] scores = null;
B. int[] scoreArray = {50,90,85};
C. String[] nameArray = new String[10];
D. String[] nameArray = {5, 3, 2};
E. int[] scores = new int[5]