Sail E0 Webinar

MCQs

Total Questions : 50 | Page 4 of 5 pages
Question 31. String s = "good job"
  1.    "od job"
  2.    "d jo"
  3.    "od jo"
  4.    StringIndexOutOfBoundsException
 Discuss Question
Answer: Option D. -> StringIndexOutOfBoundsException
Question 32. What is the correct relation between length and last-index of array?
  1.    last-index is always 1 more than the length
  2.    last-index is 1 less than the length (but not always)
  3.    last-index is always 1 less than the length
  4.    last-index is always equal to the length
 Discuss Question
Answer: Option C. -> last-index is always 1 less than the length
Question 33. Create an array of 12 strings called months
  1.    String[] months = new String[12];
  2.    String months = new String[12];
  3.    String[] months = new String[];
  4.    String[12] months = new String[];
 Discuss Question
Answer: Option A. -> String[] months = new String[12];
Question 34. How will you identify a single array?
  1.    single curly brackets
  2.    single square brackets
  3.    multiple squares brackets
  4.    single angled brackets
 Discuss Question
Answer: Option B. -> single square brackets
Question 35. Which of the following tool is used to generate API documentation in HTML format from doc comments in source code?
  1.    javap tool
  2.    javaw command
  3.    Javadoc tool
  4.    javah command
 Discuss Question
Answer: Option C. -> Javadoc tool
Question 36. What does the expression float a = 35 / 0 return?
  1.    0
  2.    Not a number
  3.    Infinity
  4.    Run time exception
 Discuss Question
Answer: Option C. -> Infinity
Question 37. Find the outputclass Test { public static void main(String args[]) { int arr[2]; System
  1.    Compile error
  2.    Exception
  3.    Garbage ValueGarbage Value
  4.    00
 Discuss Question
Answer: Option A. -> Compile error
Question 38. Attributes of an object are also known as
  1.    methods
  2.    properties
  3.    classes
  4.    functions
 Discuss Question
Answer: Option B. -> properties
Question 39. What is the default value of a Boolean variable?
  1.    True
  2.    true
  3.    False
  4.    false
 Discuss Question
Answer: Option D. -> false
Question 40. Find the output for the following
  1.    a = 2 b = 3 c = 4 d = 1
  2.    a = 2 b = 3 c = 4 d = 1
  3.    Program does not compile.
  4.    a = 1 b = 2 c = 4 d = 2
 Discuss Question
Answer: Option B. -> a = 2 b = 3 c = 4 d = 1

Latest Videos

Latest Test Papers