-
-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathInitialize.java
More file actions
25 lines (22 loc) · 799 Bytes
/
Initialize.java
File metadata and controls
25 lines (22 loc) · 799 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
package com.codefortomorrow.beginner.chapter3.solutions;
/*
* Let's practice initializing different primitive
* types. In the code below, there are variables
* initialized, but they don't have a type!
* Based on the name of the variable and its value,
* write the correct type in front of the variable's
* name so that the program works. (Be sure to uncomment
* everything when you begin working.)
*
* Note: There may be more than 1 correct answer.
*/
public class Initialize {
@SuppressWarnings("unused")
public static void main(String[] args) {
boolean isRaining = false;
double price = 5.68;
char firstInitial = 'R';
int numberOfBooks = 35; // byte and short are also acceptable, but less common
long revenue = 1_512_300_125L;
}
}