What is the output of this program?
class mainclass
{

Home | Discussion Forum

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

View More Related Question

2) What is the output of this program?

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

3) What is the output of this program?

class mainclass
{
public static void main(String args[])
{
char a = 'A';
a++;
System.out.print((int)a);
}
}

4) What will be the output?

public class Test
{
public static void main(String args[])
{
int a = 42;
double b = 42.25;
System.out.print((a%10)+" "+(b%10));
}
}

5) What is the output of this program?

class increment
{
public static void main(String args[])
{
double var1 = 1 + 5;
double var2 = var1 / 4;
int var3 = 1 + 5;
int var4 = var3 / 4;
System.out.print(var2 + " " + var4);
}
}

UP Gk Online Test

taiyari24hour.com

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