0

can someone pls explain output od this code

public class vjezbe { public static void main(String [] args){ String a="sad"; String b="SAD".toLowerCase(); if(a==b){ System.out.println(true); }else{ System.out.println(false); } System.out.println(b); } }

13th May 2021, 7:25 AM
Samir Krasnic
Samir Krasnic - avatar
3 ответов
+ 3
Use .equals() method
13th May 2021, 7:27 AM
Atul [Inactive]
+ 2
public class vjezbe { public static void main(String [] args){ String a="sad"; String b="SAD".toLowerCase(); if(a.equals(b)){ System.out.println(true); }else{ System.out.println(false); } System.out.println(b); } }
13th May 2021, 7:28 AM
Atul [Inactive]
+ 2
aaa so I cant use == here? thanks for clue i google more about this
13th May 2021, 7:34 AM
Samir Krasnic
Samir Krasnic - avatar