public class Test

{

public static void main(String ar[])

{

Integer a = 10;

Integer b =10;

Integer c = 145;

Integer d = 145;

System.out.println(a==b);

System.out.println(c==d);

}

}

Answers were Sorted based on User's Feedback



public class Test { public static void main(String ar[]) { Integer a = 10; Integer b =10;..

Answer / seven hills

true
false


because the value of Integer object should not be greater than 127...if u put<127 then always true

Is This Answer Correct ?    23 Yes 1 No

public class Test { public static void main(String ar[]) { Integer a = 10; Integer b =10;..

Answer / prashanth

true
false

The Buffer size of Integer class is -128 to 127
Except this range in all remaining cases a new object will be created.

Is This Answer Correct ?    5 Yes 2 No

public class Test { public static void main(String ar[]) { Integer a = 10; Integer b =10;..

Answer / ashish

A list of few more java interview questions like

1. By default, Java is pass by reference or pass by value. how it handles it.
2. In which scenario, you will use custom exceptions in java.
3. how garbage collection works in java
4. what is autoboxing and unboxing in java
5. how hashmap works in java

For more questions:
<a href="http://newtechnobuzzz.blogspot.com/2014/07/tricky-java-interview-questions-and.html">Check more information on java interview questions and tutorials</a>

Is This Answer Correct ?    0 Yes 0 No

public class Test { public static void main(String ar[]) { Integer a = 10; Integer b =10;..

Answer / ravi

using "Singletone Design pattern" we can prevent class creating multiple objects.

Is This Answer Correct ?    0 Yes 0 No

public class Test { public static void main(String ar[]) { Integer a = 10; Integer b =10;..

Answer / sonalgusain99@gmail.com

1.true,true

2.false,true

3.true,false







plz also gv explanation

Is This Answer Correct ?    3 Yes 6 No

public class Test { public static void main(String ar[]) { Integer a = 10; Integer b =10;..

Answer / satish

true
true

Is This Answer Correct ?    0 Yes 3 No

public class Test { public static void main(String ar[]) { Integer a = 10; Integer b =10;..

Answer / ravindra

true
true

Is This Answer Correct ?    1 Yes 9 No

Post New Answer

More Core Java Interview Questions

What is Java Reflection API? Why it’s so important to have?

0 Answers  


What is runtime locatable code?

0 Answers   Cognizant,


what really hapens when a object is created using new operator? 1.is it allocates memory to all variables and methods in the class with reference to that object?

3 Answers  


How a string is stored in memory?

0 Answers  


What java is used for?

0 Answers  






What is the difference between the paint() and repaint() methods?

0 Answers  


What is included in core java?

0 Answers  


What will be the output of the program? public class Test { public static void main(String args[]) { ArrayList<String> list = new ArrayList<String>(); list.add("2"); list.add("3"); list.add("4"); list.add("5"); System.out.println("size :"+list.size()); for(int i=0;i<list.size();i++) { list.remove(i); } System.out.println("size after:"+list.size()); } }

5 Answers   Rolta,


What is dynamic binding?

2 Answers  


What is runtime polymorphism or dynamic method dispatch?

0 Answers  


What is binary tree in java?

0 Answers  


what is polymorphism?

5 Answers   Zensar,


Categories