|
2 | 2 |
|
3 | 3 | [Example implementation](https://github.com/exercism/java/blob/master/exercises/gigasecond/.meta/src/reference/java/Gigasecond.java) |
4 | 4 |
|
5 | | -## General |
| 5 | +## General |
6 | 6 |
|
7 | 7 | - Imports: placed at the top of the file allowing access to methods/classes implemented in other files. |
8 | 8 |
|
9 | | -- Integers: Integer is a wrapper class around the primitive type `int` which contains a single field of type `int`. The difference between an `int` and an `Integer` is that `int` can only be a binary value of an integer whereas an `Integer`, being a class, has access to a number of other inbuilt functions making it more flexible to manipulation. |
| 9 | +- Integers: Integer is a wrapper class around the primitive type `int` which contains a single field of type `int`. The difference between an `int` and an `Integer` is that `int` can only be a binary value of an integer whereas an `Integer`, being a class, has access to a number of other inbuilt functions making it more flexible to manipulation. |
10 | 10 |
|
11 | 11 | - Classes: The tested method is defined in a class |
12 | 12 |
|
|
18 | 18 |
|
19 | 19 | - Overloading constructors: Sometimes there can be multiple ways to initialize a class, this is known as overloading since the name of the methods match the name of the class but only vary by their arguments. |
20 | 20 |
|
21 | | -- Scoping: `{` and `}` used to identify scope of method |
| 21 | +- Scoping: `{` and `}` used to identify scope of method |
22 | 22 |
|
23 | 23 | - Objects: creating an instance of the LocalDateTime |
24 | 24 |
|
25 | 25 | - Dates: object containing information about date |
26 | 26 |
|
27 | 27 | - Times: object containing information about the time on a specific date |
28 | 28 |
|
29 | | -- Methods: used as a way to interact with the class |
| 29 | +- Methods: used as a way to interact with the class |
30 | 30 |
|
31 | | -- Return values: returning values from a method, deonted by `return` in the method and typed in the method signature |
| 31 | +- Return values: returning values from a method, deonted by `return` in the method and typed in the method signature |
32 | 32 |
|
33 | 33 | ## Approach: Overloading Constructors |
34 | | -- Two constructors where one that takes a LocalDate object as an argument and when initialized, converts it to a LocalDateTime and another that just takes the LocalDateTime object and sets that as a property in the instance of the class. |
| 34 | + |
| 35 | +- Two constructors where one that takes a LocalDate object as an argument and when initialized, converts it to a LocalDateTime and another that just takes the LocalDateTime object and sets that as a property in the instance of the class. |
35 | 36 | - method that returns the time (`getDateTime`) adds a gigasecond to the time initialized before returning the new LocalDateTime object |
0 commit comments