Welcome to part 3 of this walkthrough!
We have conquered Method and Field in Java Island in the last part.
Now we are halfway to the end of Class and Object. Let’s go!
Java Island (Class and Object)
- (87 stars) NullPointerException Challenge 1. Hint: fix createNewCat(). Reading recommendation: https://stackoverflow.com/questions/218384/what-is-a-nullpointerexception-and-how-do-i-fix-it
- (90 stars) NullPointerException Challenge 2. Hint: fix createNewCat().
- (93 stars) Reference and Value Challenge 1. Reading recommendation: https://www.geeksforgeeks.org/reference-variable-in-java/
- (96 stars) Reference and Value Challenge 2. Hint: check all three files to find the logic behind how values are passing via the references.
- (99 stars) Reference and Value Challenge 3. Time to learn deep copy: https://www.tutorialspoint.com/what-is-deep-copy-explain-with-an-example-in-java
Congratulations! You have finished Class and Object. Let’s keep exploring this island!
Java Island (Data Structure)
- (102 stars) Data Representation Challenge 1. Time to learn data types: https://www.w3schools.com/java/java_data_types.asp
This is a sneaky question, don’t waste too much time on it. Answer: https://github.com/ByteLegendQuest/java-data-type-max-value/commit/4b2a64ab955a86b647a149cd2f3049129813029d
- (105 stars) Data Representation Challenge 2. Time to learn type casting/conversion: https://www.w3schools.com/java/java_type_casting.asp https://www.geeksforgeeks.org/type-conversion-java-examples/
- (108 stars) Data Representation Challenge 3. To save you some time, try this precision: return Math.abs(a – b) <= 1e-10;
Reading Recommendations: https://www.baeldung.com/java-comparing-doubles https://www.geeksforgeeks.org/double-equals-method-in-java-with-examples/
- (111 stars) Type Conversion and Promotion Challenge 1. Hint: Revisit the readings in Data Representation Challenge 2.
- (114 stars) Type Conversion and Promotion Challenge 2. There are many different ways, methods, or functions to complete this task. Here is mine for your reference: https://github.com/ByteLegendQuest/java-implement-type-casts/commit/623ab1975148b10bdc59d2b0338368bfe0130d77
- (117 stars) Autoboxing and Unboxing Challenge 1. Hint: add some statement in compare(). Reading Recommendation: https://www.tutorialspoint.com/what-are-the-differences-between-an-integer-and-an-int-in-java
- (120 stars) Autoboxing and Unboxing Challenge 2. Hint: Use Integer.parseInt(a) to change String a to integer; use String.valueOf(num) to change a number into String.
- (123 stars) Autoboxing and Unboxing Challenge 3. Hint and Reading Recommendation: https://www.baeldung.com/java-integer-parseint-vs-valueof
- (126 stars) Java Array Challenge 1. Hint: Use array.length to check the length of the array.
- (129 stars) Java Array Challenge 2. Revisit the examples of parseInt and valueOf.
- (132 stars) Java Array Challenge 3. Hint and Reading Recommendations: https://www.geeksforgeeks.org/arrays-copyof-in-java-with-examples/
Congratulations! We have finished Data Structure!
This is the halfway point of this game. Java is not that hard, right?
To be continued…