What will be the result of compiling and running the following code:
public class Test{ public static void main(String... args) throws Exception{ Integer i = 34; int l = 34; if(i.equals(l)){ System.out.println("true"); }else{ System.out.println("false"); } }}
public class Test{ public static void main(String... args) throws Exception{ Integer i = 34; int l = 34; if(i.equals(l)){ System.out.println("true"); }else{ System.out.println("false"); } }}What will be the result of compiling and running the following code:
public class Test{ public static void main(String... args) throws Exception{ Integer i = 34; int l = 34; if(i.equals(l)){ System.out.println("true"); }else{ System.out.println("false"); } }} Correct Answer true
Equals() method for the integer wrappers will only return true if the two primitive types and the two values are equal.
মোঃ আরিফুল ইসলাম
Feb 20, 2025