Which of the following automatic type conversion will be possible?
Which of the following automatic type conversion will be possible?
The following program:
public class Test{
static boolean isOK;
public static void main(String args[]){
System.out.print(isOK);
}
}
The following program:
public class Test{
static boolean isOK;
public static void main(String args[]){
System.out.print(isOK);
}
}
Automatic type conversion in Java takes place when
Automatic type conversion in Java takes place when
What is the output for the below code ?
1. public class Test{
2. public static void main(String[] args){
3. byte b = 6;
4. b+=8;
5. System.out.println(b);
6. b = b+7;
7. System.out.println(b);
8. }
9. }
What is the output for the below code ?
1. public class Test{
2. public static void main(String[] args){
3. byte b = 6;
4. b+=8;
5. System.out.println(b);
6. b = b+7;
7. System.out.println(b);
8. }
9. }
What will be the output for the below code ?
1. public class Test{
2. int i=8;
3. int j=9;
4. public static void main(String[] args){
5. add();
6. }
7. public static void add(){
8. int k = i+j;
9. System.out.println(k);
10. }
11. }
What will be the output for the below code ?
1. public class Test{
2. int i=8;
3. int j=9;
4. public static void main(String[] args){
5. add();
6. }
7. public static void add(){
8. int k = i+j;
9. System.out.println(k);
10. }
11. }
What is the output for the below code ?
1. public class Test{
2. public static void main(String[] args){
3. int i = 010;
4. int j = 07;
5. System.out.println(i);
6. System.out.println(j);
7. }
8. }
What is the output for the below code ?
1. public class Test{
2. public static void main(String[] args){
3. int i = 010;
4. int j = 07;
5. System.out.println(i);
6. System.out.println(j);
7. }
8. }
What will be output of following program?
public class Test{
public static void main(String[] args){
byte b=127;
b++;
b++;
System.out.println(b);
}
}
What will be output of following program?
public class Test{
public static void main(String[] args){
byte b=127;
b++;
b++;
System.out.println(b);
}
}
What will the output of the following program?
public class Test{
public static void main(String args[]){
float f = (1 / 4) * 10;
int i = Math.round(f);
System.out.println(i);
}
}
What will the output of the following program?
public class Test{
public static void main(String args[]){
float f = (1 / 4) * 10;
int i = Math.round(f);
System.out.println(i);
}
}
Size of int in Java is
Size of int in Java is
In Java byte, short, int and long all of these are
In Java byte, short, int and long all of these are
Size of float and double in Java is
Size of float and double in Java is
How many primitive data types are there in Java?
How many primitive data types are there in Java?
Determine output:
public class Test {
static void test(float x){
System.out.print("float");
}
static void test(double x){
System.out.print("double");
}
public static void main(String[] args){
test(99.9);
}
}
Determine output:
public class Test {
static void test(float x){
System.out.print("float");
}
static void test(double x){
System.out.print("double");
}
public static void main(String[] args){
test(99.9);
}
}
What is the output for the below code ?
class A{
int k;
boolean istrue;
static int p;
public void printValue(){
System.out.print(k);
System.out.print(istrue);
System.out.print(p);
}
}
public class Test{
public static void main(String argv[]){
A a = new A();
a.printValue();
}
}
What is the output for the below code ?
class A{
int k;
boolean istrue;
static int p;
public void printValue(){
System.out.print(k);
System.out.print(istrue);
System.out.print(p);
}
}
public class Test{
public static void main(String argv[]){
A a = new A();
a.printValue();
}
}
What would be the output of the following fraction of code ?
int Integer = 34 ;
char String = 'S' ;
System.out.print( Integer ) ;
System.out.print( String ) ;
What would be the output of the following fraction of code ?
int Integer = 34 ;
char String = 'S' ;
System.out.print( Integer ) ;
System.out.print( String ) ;
The smallest integer type is ......... and its size is ......... bits.
The smallest integer type is ......... and its size is ......... bits.
Java is a ........... language.
Java is a ........... language.
In Java, the word true is ................
In Java, the word true is ................
What is the output of the following program?
public class Test{
static int x = 10 ;
public static void main(String[] a){
Test test = new Test( ) ;
Test test1 = new Test( ) ;
test.x += 1 ;
System.out.println( test.x + test1.x ) ;
}
}
What is the output of the following program?
public class Test{
static int x = 10 ;
public static void main(String[] a){
Test test = new Test( ) ;
Test test1 = new Test( ) ;
test.x += 1 ;
System.out.println( test.x + test1.x ) ;
}
}
What is the output for the below code?
public class Test{
int _$;
int $7;
int do;
public static void main(String argv[]){
Test test = new Test();
test.$7=7;
test.do=9;
System.out.println(test.$7);
System.out.println(test.do);
System.out.println(test._$);
}
}
What is the output for the below code?
public class Test{
int _$;
int $7;
int do;
public static void main(String argv[]){
Test test = new Test();
test.$7=7;
test.do=9;
System.out.println(test.$7);
System.out.println(test.do);
System.out.println(test._$);
}
}
What will be output of the following program code?
public class Test{
public static void main(String[] a){
short x = 10;
x = x*5;
System.out.print(x);
}
}
What will be output of the following program code?
public class Test{
public static void main(String[] a){
short x = 10;
x = x*5;
System.out.print(x);
}
}
The following fraction of code
double STATIC = 2.5 ;
System.out.println( STATIC );
The following fraction of code
double STATIC = 2.5 ;
System.out.println( STATIC );
Determine output:
class A{
public static void main(String args[]){
int x;
x = 10;
if(x == 10){
int y = 20;
System.out.print("x and y: "+ x + " " + y);
y = x*2;
}
y = 100;
System.out.print("x and y: " + x + " " + y);
}
}
Determine output:
class A{
public static void main(String args[]){
int x;
x = 10;
if(x == 10){
int y = 20;
System.out.print("x and y: "+ x + " " + y);
y = x*2;
}
y = 100;
System.out.print("x and y: " + x + " " + y);
}
}
Determine output:
public class Test{
int i = 34;
public static void main(String args[]){
Test t1 = new Test();
Test t2 = new Test();
t1.i = 65;
System.out.print(t1.i);
System.out.print(t2.i);
}
}
Determine output:
public class Test{
int i = 34;
public static void main(String args[]){
Test t1 = new Test();
Test t2 = new Test();
t1.i = 65;
System.out.print(t1.i);
System.out.print(t2.i);
}
}
What is the output of the following program?
class A{
public static void main(String args[]){
byte b;
int i = 258;
double d = 325.59;
b = (byte) i;
System.out.print(b);
i = (int) d;
System.out.print(i);
b = (byte) d;
System.out.print(b);
}
}
What is the output of the following program?
class A{
public static void main(String args[]){
byte b;
int i = 258;
double d = 325.59;
b = (byte) i;
System.out.print(b);
i = (int) d;
System.out.print(i);
b = (byte) d;
System.out.print(b);
}
}
What will be the output for the below code ?
1. public class Test{
2. public static void main(String[] args){
3. byte i = 128;
4. System.out.println(i);
5. }
6. }
What will be the output for the below code ?
1. public class Test{
2. public static void main(String[] args){
3. byte i = 128;
4. System.out.println(i);
5. }
6. }
Determine output:
public class Test{
int a = 10;
public void method(int a){
a += 1;
System.out.println(++a);
}
public static void main(String args[]){
Test t = new Test();
t.method(3);
}
}
Determine output:
public class Test{
int a = 10;
public void method(int a){
a += 1;
System.out.println(++a);
}
public static void main(String args[]){
Test t = new Test();
t.method(3);
}
}