What is the output of this program?
class variable_scope

Home | Discussion Forum

What is the output of this 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);
}
}

View More Related Question

2) What is the output of this program?

class Modulus
{
public static void main(String args[])
{
double a = 25.64;
int b = 25;
a = a % 10;
b = b % 10;
System.out.println(a + " " + b);
}
}

3) What is the output of this 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);
}
}

4) What is the output of this 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++;
}
}
}

5) What will be the output?

if(1 + 1 + 1 + 1 + 1 == 5)
{
System.out.print("TRUE");
}
else
{
System.out.print("FLASE");
}

UP Gk Online Test

taiyari24hour.com

Study 2 Online Says....
Kindly log in or signup.