Question 1 of 25
Hints left: 3
Q1
Which of these is a process of converting a simple data type into a class?
Q2
Which of these is a method can generate a boolean output?
Q3
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])); } }
Q4
In Java, can a subclass access private members (fields and methods) of its superclass?
Q5
What is the "super" keyword used for in Java?
Q6
What is method overriding in Java?
Q7
What is inheritance in Java?
Q8
What is a superclass in Java?
Q9
Which of these method(s) is/are used for writing bytes to an outputstream?
Q10
In Java, which keyword is used to implement inheritance between classes?
Q11
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()); } }
Q12
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)); } }
Q13
Which of these exceptions will be thrown if we use null reference for an arithmetic operation?
Q14
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); } }
Q15
Which of these classes is not included in java.lang?
Q16
Which of the following reference types cannot be generic?
Q17
Which of these class can be used to implement the input stream that uses a character array as the source?
Q18
In Java, can a subclass inherit constructors from its superclass?
Q19
Which of these is a super class of wrappers Long, Character & Integer?
Q20
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(); } }
Q21
What will be the output of the following Java program? class Output { public static void main(String args[]) { String x = Boolean.toString(false); } }
Q22
What is the difference between "extends" and "implements" in Java?
Q23
Which of these keywords is used to define packages in Java?
Q24
In Java, can a subclass override a private method from its superclass?
Q25
What will be the output of the following Java code snippet? int a = random.nextInt(7) + 4;