Open Source Your Knowledge, Become a Contributor
Technology knowledge has to be shared and made accessible for free. Join the movement.
2.2 Beyond ints
Video Game Example Initial Attempt
1
2
3
4
5
6
7
8
class VideoGame {
String mainTitle = "Final Fantasy XV";
String mainPrice = "$49.99";
String dlcTitle = "Episode Ardyn";
String dlcPrice = "$4.99";
String totalPrice = mainPrice + dlcPrice;
}
Enter to Rename, Shift+Enter to Preview
Video Game Example Second Attempt
1
2
3
4
5
6
7
8
class VideoGame {
String mainTitle = "Final Fantasy XV";
double mainPrice = 49.99;
String dlcTitle = "Episode Ardyn";
double dlcPrice = 4.99;
double totalPrice = mainPrice + dlcPrice;
}
Enter to Rename, Shift+Enter to Preview
Number Precision
1
2
3
4
5
6
7
class Numbers {
int num1 = 1 + 2;
int num2 = 3;
double num3 = 1.1 + 2.2;
double num4 = 3.3;
}
Enter to Rename, Shift+Enter to Preview
Open Source Your Knowledge: become a Contributor and help others learn. Create New Content