Analyze the following code:public class Test { int x; public… Analyze the following code:public class Test { int x; public Test(String t) { System.out.println(“Test”); } public static void main(String[] args) { Test test = new Test(); System.out.println(test.x); }} Read Details
Which method can be used to create an input object for file… Which method can be used to create an input object for file temp.txt? Read Details
Which class contains the method for checking whether a file… Which class contains the method for checking whether a file exists? Read Details
Assume Cylinder is a subtype of Circle. Analyze the followin… Assume Cylinder is a subtype of Circle. Analyze the following code:Circle c = new Circle (5);Cylinder c = cy; Read Details
What is displayed by the following code? System.out.print(“H… What is displayed by the following code? System.out.print(“Hi, ABC, good”.matches(“ABC “) + ” “); System.out.println(“Hi, ABC, good”.matches(“.*ABC.*”)); Read Details
Which of the following is the correct statement to return a… Which of the following is the correct statement to return a string from an array a of characters? Read Details
What is the output of the following code?public class Test {… What is the output of the following code?public class Test { public static void main(String[] args) { Object o1 = new Object(); Object o2 = new Object(); System.out.print((o1 == o2) + ” ” + (o1.equals(o2))); }} Read Details
What is displayed by the following code? System.out.print(“A… What is displayed by the following code? System.out.print(“A,B;C”.replaceAll(“,;”, “#”) + ” “); System.out.println(“A,B;C”.replaceAll(“[,;]”, “#”)); Read Details
What is displayed by the following code? public static void… What is displayed by the following code? public static void main(String[] args) { String[] tokens = “Welcome to Java”.split(“o”); for (int i = 0; i < tokens.length; i++) { System.out.print(tokens[i] + " "); } } Read Details
Analyze the following code:public class Test { public static… Analyze the following code:public class Test { public static void main(String[] args) throws MyException { System.out.println(“Welcome to Java”); }}class MyException extends Error {} Read Details