Select the correct answer from the option ..
please read question carefully before answer ..
🔥5 plays5.0 (1)Published
0 of 5 answered
Stacked
An unchecked exception occurs in a method dosomething()
Should other code be added in the dosomething() method for it to compile and execute?
1/5
Choose one
The Exception must be caught
The Exception must be declared to be thrown.
The Exception must be caught or declared to be thrown.
No other code needs to be added.
Given the code fragment:
interface SampleClosable {
public void close () throws java.io.IOException;
}
Which three implementations are valid?
2/5
Choose one
public class Test implements SampleCloseable {
public void close() throws java.io.IOException {
/ / do something
}
}
public class Test implements SampleCloseable {
public void close() throws Exception {
/ / do something
}
}
public class Test implements SampleCloseable {
public void close() throws java.io.FileNotFoundException {
/ / do something
}
}
public class Test extends SampleCloseable {
public void close() throws java.IO.IOException {
/ / do something
}
}
public class SampleClass {
public static void main(String[] args) {
AnotherSampleClass asc = new AnotherSampleClass();
SampleClass sc = new SampleClass();
// TODO code application logic here
}
}
class AnotherSampleClass extends SampleClass {
}
Which statement, when inserted into line "// TODO code application logic here ", is valid change?
3/5
Choose all that apply
asc = sc;
sc = asc;
asc = (object) sc;
asc = sc.clone ()
Given the code fragment:
System.out.println("Result: " + 2 + 3 + 5);
System.out.println("Result: " + 2 + 3 * 5);
What is the result?