Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

even if param and DEFAUL_PARAM are the same, they are not equal?

public String verify(String param){
    String verify = new String(DEFAULT_PARAM);
    if(param != verify){
           throw new Exception("is not the same");
        } 
    else{
        System.out.printf("passed") 
        } 
}

i need to verify 2 string. when good password print passed but exception is throw even when password is good.

i tried to change my DEFAULT_PARAM, without any luck.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

you dont need new string, just verify with DEFAULT_PARAM.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading