Question 1 of 25
Hints left: 3
Q1
Which of these is a process of converting a simple data type into a class?
Q2
What will be the output of the following Java code snippet? int a = random.nextInt(7) + 4;
Q3
Which of these method(s) is/are used for writing bytes to an outputstream?
Q4
What is the "super" keyword used for in Java?
Q5
Which of the following reference types cannot be generic?
Q6
What will be the output of the following Java program? class X { int a; double b; } class Y extends X { int c; } class Output { public static void main(String args[]) { X a = new X(); Y b = new Y(); Class obj; obj = b.getClass(); System.out.print(obj.isInstance(a)); } }
Q7
What is inheritance in Java?
Q8
What will be the output of the following Java program? class Output { public static void main(String args[]) { double x = 3.14; int y = (int) Math.toDegrees(x); System.out.print(y); } }
Q9
What will be the output of the following Java program? import java.util.*; class LOCALE_CLASS { public static void main(String args[]) { Locale obj = new Locale("INDIA") ; System.out.print(obj.getCountry()); } }
Q10
Which of these class can be used to implement the input stream that uses a character array as the source?
Q11
In Java, can a subclass access private members (fields and methods) of its superclass?
Q12
What is the result of the following code snippet? class Parent { void display() { System.out.println("Parent"); } } class Child extends Parent { void display() { System.out.println("Child"); } } public class Main { public static void main(String[] args) { Parent obj = new Child(); obj.display(); } }
Q13
What is method overriding in Java?
Q14
In Java, which keyword is used to implement inheritance between classes?
Q15
In Java, can a subclass override a private method from its superclass?
Q16
What is the difference between "extends" and "implements" in Java?
Q17
What will be the output of the following Java program? class Output { public static void main(String args[]) { String x = Boolean.toString(false); } }
Q18
Which of these is a super class of wrappers Long, Character & Integer?
Q19
What is a superclass in Java?
Q20
Which of these is a method can generate a boolean output?
Q21
Which of these exceptions will be thrown if we use null reference for an arithmetic operation?
Q22
What will be the output of the following Java program? class Output { public static void main(String args[]) { char a[] = {'a', '5', 'A', ' '}; System.out.print(Character.isDigit(a[0]) + " "); System.out.print(Character.isWhitespace(a[3]) + " "); System.out.print(Character.isUpperCase(a[2])); } }
Q23
In Java, can a subclass inherit constructors from its superclass?
Q24
Which of these classes is not included in java.lang?
Q25
Which of these keywords is used to define packages in Java?