Admission Going On…. Our Android App Available on Google Play Store…
SMC ACADEMY Mock Test. Its an Online Computer Based Mock Test.Please enter your email: 1. Use the following declaration and initialization to evaluate the Java expressionsint a = 2, b = 3, c = 4, d = 5; float k = 4.3f;System.out.println (-2U * ( g – k ) +c); Syntax error 2 6 3 1 2. Identify, from among the following, the incorrect variable name(s). _theButton $PeopleLoveAnimal 3rdPosition CurrentWeatherStateofplanet 3. What is the type and value of the following expression? (Notice the integer division) -4 + 1/2 + 2*-3 + 5.0 double -4.5 int -4 double -5.0 int -5 4. Use the following declaration and initialization to evaluate the Java expressionsint a = 2, b = 3, c = 4, d = 5; float k = 4.3f;System.out.println( – -b * a + c *d – -); 20 24 28 21 5. Mark the incorrect statement from the following: In java it is not easy to write C-like so called procedural programs Java is not a language for internet programming. In java language error processing is built into the language Java is a fully object oriented language with strong support for proper software engineering techniques 6. The number of 3-digit numbers divisible by 6, is … 150 149 166 151 7. What is the output of the following code:class eq { public static void main(String args[]) { String s1 = “Hello”; String s2 = new String(s1); System.out.println(s1==s2); } } 1 0 False True 8. The cost of 2 chairs and 3 tables is Rs.1300. The cost of 3 chairs and 2 tables is Rs.1200. The cost of each table is more than that of each chair by? 70 50 80 100 9. The default value of a static integer variable of a class in Java is, 0 -1 Null 1 Garbage Value 10. Every number system has a base, which is called Radix None of Above Subscript Index 11. Use the following declaration and initialization to evaluate the Java expressionsint a = 2, b = 3, c = 4, d = 5; float k = 4.3f;System.out.println(a++); 4 Syntax error 3 2 12. Consider the following Java program :class IfStatement{ public static void main(String args[]) { int a=2, b=3; if (a==3) if (b==3) System.out.println(“===============”); else System.out.println(“#################”); System.out.println(“&&&&&&&&&&&”); } }Which of the following will the output be? ===============&&&&&&&&&&& None of Above &&&&&&&&&&& =============== 13. Use the following declaration and initialization to evaluate the Java expressionsint a = 2, b = 3, c = 4, d = 5; float k = 4.3f;System.out.println (c=c++); 4 2 Syntax error 8 14. The cost of 10 kg of apples is equal to the cost of 24 kg of rice. The cost of 6 kg of flour equals the cost of 2 kg of rice. The cost of each kg of flour is Rs.20.50. Find the total cost of 4 kg of apples, 3 kg of rice and 5 kg of flour? Rs.849.40 Rs.901.60 Rs.877.40 Rs.815.20 None of Above 15. What is the output of the following program:public class smc { static int i = 1; public static void main(String args[]) { System.out.println(i+” , “); m(i); System.out.println(i); } public void m(int i) { i += 2; } } 4 , 1 1 , 3 3 , 1 1 , 1 16. Collection of 1024 Bytes 1 GB 1 KB 1 MB 1 TB 17. The sum of the digits of a two-digit number is 12. The difference of the digits is 6. Find the number? 93 75 48 39 18. What will be printed as the output of the following program?public class smc { public static void main(String args[]) { int i = 0; i = i++ + i; System.out.println(“I = ” +i); } } I = 1 I = 0 I = 2 Compile-time Error. 19. Consider the two methods (within the same class) public static int foo(int a, String s) { s = “Yellow”; a=a+2; return a; } public static void bar() { int a=3; String s = “Blue”; a = foo(a,s); System.out.println(“a=”+a+” s=”+s); } public static void main(String args[]) { bar(); }What is printed on execution of these methods? a = 3 s = Yellow a = 3 s = Blue none of the above. a = 5 s = Blue 20. 106 × 106 – 94 × 94 = ? 1904 2004 2400 1906 Loading … Question 1 of 20
SMC ACADEMY Mock Test. Its an Online Computer Based Mock Test.
Please enter your email:
1. Use the following declaration and initialization to evaluate the Java expressions
int a = 2, b = 3, c = 4, d = 5; float k = 4.3f;
System.out.println (-2U * ( g – k ) +c);
2. Identify, from among the following, the incorrect variable name(s).
3. What is the type and value of the following expression? (Notice the integer division) -4 + 1/2 + 2*-3 + 5.0
4. Use the following declaration and initialization to evaluate the Java expressions
System.out.println( – -b * a + c *d – -);
5. Mark the incorrect statement from the following:
6. The number of 3-digit numbers divisible by 6, is …
7. What is the output of the following code:
class eq { public static void main(String args[]) { String s1 = “Hello”; String s2 = new String(s1); System.out.println(s1==s2); } }
8. The cost of 2 chairs and 3 tables is Rs.1300. The cost of 3 chairs and 2 tables is Rs.1200. The cost of each table is more than that of each chair by?
9. The default value of a static integer variable of a class in Java is,
10. Every number system has a base, which is called
11. Use the following declaration and initialization to evaluate the Java expressions
System.out.println(a++);
12. Consider the following Java program :
class IfStatement{ public static void main(String args[]) { int a=2, b=3; if (a==3) if (b==3) System.out.println(“===============”); else System.out.println(“#################”); System.out.println(“&&&&&&&&&&&”); } }
Which of the following will the output be?
13. Use the following declaration and initialization to evaluate the Java expressions
System.out.println (c=c++);
14. The cost of 10 kg of apples is equal to the cost of 24 kg of rice. The cost of 6 kg of flour equals the cost of 2 kg of rice. The cost of each kg of flour is Rs.20.50. Find the total cost of 4 kg of apples, 3 kg of rice and 5 kg of flour?
15. What is the output of the following program:
public class smc { static int i = 1; public static void main(String args[]) { System.out.println(i+” , “); m(i); System.out.println(i); } public void m(int i) { i += 2; } }
16. Collection of 1024 Bytes
17. The sum of the digits of a two-digit number is 12. The difference of the digits is 6. Find the number?
18. What will be printed as the output of the following program?
public class smc { public static void main(String args[]) { int i = 0; i = i++ + i; System.out.println(“I = ” +i); } }
19. Consider the two methods (within the same class) public static int foo(int a, String s) { s = “Yellow”; a=a+2; return a; } public static void bar() { int a=3; String s = “Blue”; a = foo(a,s); System.out.println(“a=”+a+” s=”+s); } public static void main(String args[]) { bar(); }
What is printed on execution of these methods?
20. 106 × 106 – 94 × 94 = ?
Question 1 of 20