Skip to content

Commit 2c9fbe6

Browse files
author
codehouseindia
authored
Merge pull request codehouseindia#140 from Snehajoshi312/patch-1
1add.java
2 parents 8b69615 + 041f873 commit 2c9fbe6

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

1add.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
class Main {
2+
public static void main(String[] args) {
3+
4+
// create boolean variables
5+
boolean booleanValue1 = true;
6+
boolean booleanValue2 = false;
7+
8+
// convert boolean to string
9+
// using valueOf()
10+
String stringValue1 = String.valueOf(booleanValue1);
11+
String stringValue2 = String.valueOf(booleanValue2);
12+
13+
System.out.println(stringValue1); // true
14+
System.out.println(stringValue2); // true
15+
}
16+
}

0 commit comments

Comments
 (0)