9836577512   info@smcacademy.com

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. 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?

 
 
 
 

2. What is the type and value of the following expression? (Notice the integer division)
-4 + 1/2 + 2*-3 + 5.0

 
 
 
 

3. 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 (c=c++);

 
 
 
 

4. 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(a++);

 
 
 
 

5. Every number system has a base, which is called

 
 
 
 

6. Collection of 1024 Bytes

 
 
 
 

7. The default value of a static integer variable of a class in Java is,

 
 
 
 
 

8. Mark the incorrect statement from the following:

 
 
 
 

9. The number of 3-digit numbers divisible by 6, is …

 
 
 
 

10. 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?

 
 
 
 

11. The sum of the digits of a two-digit number is 12. The difference of the digits is 6. Find the number?

 
 
 
 

12. 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?

 
 
 
 
 

13. Identify, from among the following, the incorrect variable name(s).

 
 
 
 

14. 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);
}
}

 
 
 
 

15. 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);
}
}

 
 
 
 

16. 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?

 
 
 
 

17. 106 × 106 – 94 × 94 = ?

 
 
 
 

18. 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;
}
}

 
 
 
 

19. 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);

 
 
 
 
 

20. 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( – -b * a + c *d – -);

 
 
 
 

Question 1 of 20