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

}

}

Answer Posted / ravi

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

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is == and === in javascript?

563


Explain the use of volatile field modifier?

639


What is a lambda expression ? What's its use ?

567


What is private protected in java?

555


How to reverse string in java?

619






Explain the inheritance?

577


What is a type parameter in java?

534


What is the role of garbage collector in java?

495


What is printwriter in java?

522


Where is the singleton class used?

587


Is it safe to install java on my computer?

546


What are different types of inner classes ?

567


What is the use of private static?

538


What is object in java?

540


How do you add spaces in java?

516