Question 1 of 25
Hints left: 3
Q1
What will be the output of the following Java program? class mainclass { public static void main(String args[]) { char a = 'A'; a++; System.out.print((int)a); } }
Q2
What will be the output of the following Java program? class array_output { public static void main(String args[]) { int array_variable [] = new int[10]; for (int i = 0; i < 10; ++i) { array_variable[i] = i/2; array_variable[i]++; System.out.print(array_variable[i] + " "); i++; } } }
Q3
Which of these occupy first 0 to 127 in Unicode character set used for characters in Java?
Q4
How to identify if a timezone is eligible for DayLight Saving?
Q6
What will be the output of the following Java code? class asciicodes { public static void main(String args[]) { char var1 = 'A'; char var2 = 'a'; System.out.println((int)var1 + " " + (int)var2); } }
Q7
What will be the output of the following Java code snippet? public class AddDemo { public static void main(String args[]) { BigDecimal b = new BigDecimal("23.43"); BigDecimal br = new BigDecimal("24"); BigDecimal bres = b.add(new BigDecimal("450.23")); System.out.println("Add: "+bres); MathContext mc = new MathContext(2, RoundingMode.DOWN); BigDecimal bdecMath = b.add(new BigDecimal("450.23"), mc); System.out.println("Add using MathContext: "+bdecMath); } }
Q8
What will be the output of the following Java code? enum Season { WINTER, SPRING, SUMMER, FALL }; System.out.println(Season.WINTER.ordinal());
Q9
What will be the output of the following Java program? class mainclass { public static void main(String args[]) { boolean var1 = true; boolean var2 = false; if (var1) System.out.println(var1); else System.out.println(var2); } }
Q10
Which of these is necessary condition for automatic type conversion in Java?
Q11
What will be the output of the following Java program? class c { public void main( String[] args ) { System.out.println( "Hello" + args[0] ); } }
Q12
Literals in java must be appended by which of these?
Q13
What is the order of variables in Enum?
Q14
Which class is a library of functions to perform arithmetic operations of BigInteger and BigDecimal?
Q15
Which of these coding types is used for data type characters in Java?
Q16
What will be the output of the following Java program? class variable_scope { public static void main(String args[]) { int x; x = 5; { int y = 6; System.out.print(x + " " + y); } System.out.println(x + " " + y); } }
Q17
Can we create an instance of Enum outside of Enum itself?
Q18
Which of the following is not provided by BigDecimal?
Q19
Which of these is long data type literal?
Q20
What will be the output of the following Java program? class array_output { public static void main(String args[]) { char array_variable [] = new char[10]; for (int i = 0; i < 10; ++i) { array_variable[i] = 'i'; System.out.print(array_variable[i] + "" ); i++; } } }
Q21
What will be the output of the following Java code? class average { public static void main(String args[]) { double num[] = {5.5, 10.1, 11, 12.8, 56.9, 2.5}; double result; result = 0; for (int i = 0; i < 6; ++i) result = result + num[i]; System.out.print(result/6); } }
Q22
What does LocalTime represent?
Q23
What is Truncation in Java?
Q24
What will be the output of the following Java code snippet? class A { } enum Enums extends A { ABC, BCD, CDE, DEF; }
Q25
How to convert Date object to String?