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. Collection of 1024 Bytes

 
 
 
 

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

 
 
 
 

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

 
 
 
 
 

4. Mark the incorrect statement from the following:

 
 
 
 

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

 
 
 
 
 

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

 
 
 
 

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

 
 
 
 

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

 
 
 
 

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

 
 
 
 

10. 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++);

 
 
 
 

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

 
 
 
 

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

 
 
 
 

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

 
 
 
 

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

 
 
 
 

15. 106 × 106 – 94 × 94 = ?

 
 
 
 

16. 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++);

 
 
 
 

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

 
 
 
 
 

18. 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 – -);

 
 
 
 

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

 
 
 
 

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

 
 
 
 

Question 1 of 20