Skip to content

Commit f8457d7

Browse files
committed
Fix VariableTypes solution errors
- Rename duplicate `decimal` variable - Remove unnecessary `d` in the `number` double - Fix type of `dogsOut` and `name` variables - Suppress unused variable warnings
1 parent 1a9bd2f commit f8457d7

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/com/codefortomorrow/beginner/chapter2/solutions/VariableTypes.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
*/
99

1010
public class VariableTypes {
11+
@SuppressWarnings("unused")
1112
public static void main(String[] args) {
1213
// write your code here
1314

@@ -18,16 +19,16 @@ public static void main(String[] args) {
1819
float decimal = 23.32544f;
1920

2021
// define a double variable on line 21
21-
double decimal = 23.2352536d;
22+
double number = 23.2352536;
2223

2324
// define a boolean variable on line 24 (Hint: true/false)
24-
double dogsOut = true; // the dogs are out :)
25+
boolean dogsOut = true; // the dogs are out :)
2526

2627
// define a character variable on line 27
2728
char letter = 'A';
2829

2930
// define a string variable on line 30
30-
char name = "Jeff";
31+
String name = "Jeff";
3132

3233
}
3334
}

0 commit comments

Comments
 (0)