-
Notifications
You must be signed in to change notification settings - Fork 124
Expand file tree
/
Copy pathExercise.java
More file actions
41 lines (25 loc) · 1.43 KB
/
Exercise.java
File metadata and controls
41 lines (25 loc) · 1.43 KB
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
package com.booleanuk.core;
import com.booleanuk.helpers.ExerciseBase;
public class Exercise extends ExerciseBase {
// Below is an example of a class member in Java.
// Where a class describes a thing, a member describes its attributes.
// If Car were a class, some members of it might be colour, transmission, make and model.
// The structure of defining a member is <visibility> <data type> <name> = <value>
// The below member has a visibility of public, meaning other classes can see and change the value.
// It has data type of int, which stands for integer. A numeric value.
// Its name can be anything as long as that name isn't already in use.
public int answerToTheUltimateQuestion = 42;
// 1. Create an integer member named age with a value of 32
public int age = 32;
// 2. Create a String member named firstName with a value of "Jane"
public String firstName = "Jane";
// 3. Create a boolean member named isProgrammer with a value of true
public boolean isProgrammer = true;
// 4. Change the value below so that the tests pass. Check the README.md file for instructions on
// running and reading tests
public int firstNumber = 9182;
// 5. Change the value below so that the tests pass
public String firstString = "Java is to Javascript what car is to carpet.";
// 6. Change the visibility below so that the tests pass
public boolean isVisible = true;
}