CrazyEngineers
  • Query in below java code

    radha gogia

    Member

    Updated: Oct 27, 2024
    Views: 1.3K
    String a= "/u0041";
    String h=new String("A");
    System.out.println(a==h);
    System.out.println(a.hashCode()==h.hashCode());


    Please explain why the second print statement is giving false when in the string pool we have the same string literal "A".
    0
    Replies
Howdy guest!
Dear guest, you must be logged-in to participate on CrazyEngineers. We would love to have you as a member of our community. Consider creating an account or login.
Home Channels Search Login Register