Given:
Which is true about line 1?
A. If the value is not present, a NoSuchElementException is thrown at run time.
B. It always executes the System.out::print statement.
C. If the value is not present, a NullPointerException is thrown at run time.
D. If the value is not present, nothing is done.
Given:
What is the result?
A. An exception is thrown at runtime.
B. 42=(x+y)=42
C. 42=(x+y)=6
D. 6=(x+y)=42
E. 6=(x+y)=6
Given: What must be added in line 1 to compile this class?
A. catch(IOException e) { }
B. catch(FileNotFoundException | IndexOutOfBoundsException e) { }
C. catch(FileNotFoundException | IOException e) { }
D. catch(IndexOutOfBoundsException e) { }catch(FileNotFoundException e) { }
E. catch(FileNotFoundException e) { }catch(IndexOutOfBoundsException e) { }
Given the code fragment:
Which two code snippets inserted independently inside print method print Mondial: domainmodal?
A. Main.prefix + Main.name
B. prefix + getName
C. Main.prefix + Main.getName()
D. new Main().prefix + new Main().name
E. prefix + name
F. prefix + Main.name
Given: What is the result?
A. Good Morning, Potter
B. Good Night, Potter
C. Good Morning, Harry
D. Good Night, Harry
Given:
What action ensures successful compilation?
A. Replace public Color(int c) with private Color(int c).
B. Replace int c; with private int c;.
C. Replace int c; with private final int c;.
D. Replace enum Color implements Serializable with public enum Color.
E. Replace enum Color with public enum Color.
Given:
What is the result?
A. 1.99,2.99,0
B. 1.99,2.99,0.0
C. The compilation fails.
D. 1.99,2.99
Given:
Why does this compilation fail?
A. The method Y. print (object) does not call the method super.print (object)
B. The method x. print (object) is not accessible to Y.
C. In method x. print (Collection), system. Out :: prints is an invalid Java identifier.
D. The method print (object) and the method print (object...) are duplicates of each other.
E. The method Y. print (object...) cannot override the final method x.print (object....).
Given:
executed with this command: java Main one two three What is the result?
A. 0). one
B. 0). one1). two2). three
C. The compilation fails.
D. It creates an infinite loop printing:0). one1). two1). two...
E. A java.lang.NullPointerException is thrown.
Given:
What is the output?
A. null
B. A NoSuchElementException is thrown at run time.
C. Duke
D. A NullPointerException is thrown at run time.