Created
March 1, 2021 10:37
-
-
Save Alkimisti/7ce1493eab506bdfb1f25400cdd3c1aa to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class StringToBoolean { | |
public static void main(String[] args) { | |
String s1 = "true"; | |
boolean b1 = Boolean.parseBoolean(s1); | |
System.out.println(b1); | |
String s2 = "TRUE"; | |
boolean b2 = Boolean.parseBoolean(s2); | |
System.out.println(b2); | |
String s3 = "yes"; | |
boolean b3 = Boolean.parseBoolean(s3); | |
System.out.println(b3); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment