ByteLegend Walkthrough Part III

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)

  1. (87 stars) NullPointerException Challenge 1. Hint: fix createNewCat(). Reading recommendation: 
  2. (90 stars) NullPointerException Challenge 2. Hint: fix createNewCat().
  3. (93 stars) Reference and Value Challenge 1. Reading recommendation: 
  4. (96 stars) Reference and Value Challenge 2. Hint: check all three files to find the logic behind how values are passing via the references. 
  5. (99 stars) Reference and Value Challenge 3. Time to learn deep copy: 

Congratulations! You have finished Class and Object. Let’s keep exploring this island!

Java Island (Data Structure)

  1. (102 stars) Data Representation Challenge 1. Time to learn data types: 

This is a sneaky question, don’t waste too much time on it. Answer: 

  1. (105 stars) Data Representation Challenge 2. Time to learn type casting/conversion: 
  2. (108 stars) Data Representation Challenge 3. To save you some time, try this precision: return Math.abs(a – b) <= 1e-10;

Reading Recommendations: 

  1. (111 stars) Type Conversion and Promotion Challenge 1. Hint: Revisit the readings in Data Representation Challenge 2. 
  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: 
  3. (117 stars) Autoboxing and Unboxing Challenge 1. Hint: add some statement in compare(). Reading Recommendation: 
  4. (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.
  5. (123 stars) Autoboxing and Unboxing Challenge 3. Hint and Reading Recommendation: 
  6. (126 stars) Java Array Challenge 1. Hint: Use array.length to check the length of the array.
  7. (129 stars) Java Array Challenge 2. Revisit the examples of parseInt and valueOf.
  8. (132 stars) Java Array Challenge 3. Hint and Reading Recommendations:

Congratulations! We have finished Data Structure!

This is the halfway point of this game. Java is not that hard, right?

To be continued…

ByteLegend Walkthrough Part II

Welcome to part 2 of this walkthrough!

For the past month, I was focusing on my capstone project and the rest 3 courses to graduate from my CS degree. Meanwhile, I explored some more tech about Flask in Python and database knowledge.

I am planning to finish this walkthrough in 6 parts, each part would cover about 40 stars. I will try my best to publish the remaining 4 parts before Christmas.

Thanks for your time and patience.

Java Island (Method and Field)

  1. (43 stars) Java Field Challenge 1. Create a Static Field. In this task, you are asking to create a static variable (public static String message = “Hello”;) in to understand what is a static field. For more details, I recommend you to read this:
  2. (46 stars) Java Field Challenge 2. Implement a SWAP function using static variables and then destroy the tower. Hint: create a temporary variable.
  3. (49 stars) Java Method Innovation. Learn the meaning of refactor, find the similarity and solve the puzzle, then destroy the tower. 

Recommended reading:

  1. (52 stars) Local Variable and Scope Challenge 1. Fix the compiling issue. Hint: like C++, declare the variable and then assign it a value. 


  1. (55 stars) Local Variable and Scope Challenge 2. This is an easy but tricky task. Learn how to use constructor and “this” in a class. 

Answer Option 1: 

Answer Option 2:

  1. (56 stars) Now, go to Dungeon: Debugger. It is time to learn how to set a breakpoint to debug! Click on the “Debugger” Chest. Clone the project into your local IDE. Open, then click the space next to line number 29. It is the line to return the result variable. You should see a red dot like in the picture if you are also using IDEA.

Now debug this file by clicking on the bug button in the top bar or find it in the Run dropdown or simply press Ctrl + D and then find the result variable value in the right bottom window. Copy that string and submit it to earn a star. You should get a Chest key to earn 100 golds.

  1. (57 stars) Click on the “Conditional Breakpoint” Chest. Similarly, clone the project and open This time, put a breakpoint at line 20. Then right click the red spot to add the condition. The rest of the steps are the same as the last task.
  2. (60 stars) Method Recursion Challenge 1. Go back to Java Island. It is time to practice some recursion algorithms. Have fun! 


  1. (63 stars) Method Recursion Challenge 2. Fibonacci Question. 

Recommendation Reading: 

Congratulations! You completed the Method and Field Section. Let’s move on!

Java Island (Class and Object)

  1. (66 stars) Class and Object Challenge 1. Learn what a class is in Java. 

Recommended Reading: 

  1. (69 stars) Class and Object Challenge 2. Learn what an object is in Java. Use the sword to destroy the tower.
  2. (72 stars) Instance Field. Hint: Check the file in the pet folder.
  3. (75 stars) Instance Method. Hint: Use “”.
  4. (78 stars) Instance Constructor Challenge 1. Time to learn constructor: 
  5. (81 stars) Instance Constructor Challenge 2. Time to learn overloading constructor: 
  6. (84 stars) Instance Constructor Challenge 3. Hint: According to, you will need to design two overloading constructors in

To be continued…

Part III:

PS: A typo found and reported to the development team:

Game Data Contributor:    English version contains CN chars

Transactions in Databases

I am in charge of the backend database part of our capstone project. Therefore, I am taking CS340, Introduction to Database, at OSU at the same time. In the design and implementation of our capstone project’s database, I start to understand the importance of database transaction.

When creating a database management system to store, retrieve, and run queries on data, we usually design the entity relationship diagram and the database schema based on the entities and attributes of the objects in a system. Then after the creation, a database transaction performs the unit level of update to this system to provide the data updates. For example, in an e-commerce system, users, products, and locations are entities; orders are the database transactions. Each order contains the information about which user requires what quantity of which products from which locations. Based on this order, the user will pay some amount of money; the store will receive such an amount of money; some amount of product A will be removed from location X; the exact amount of product A will then be delivered to the user’s address. A straightforward transaction record would ensure the database not to be interfered by multiple concurrent access and to cause some errors. Plus, even when an error did happen, the database could rollback based on the related transaction. Therefore, a set of properties of database transactions was concluded as Atomicity, Consistency, Isolation, and Durability.

Atomicity guarantees that each transaction is treated as a single “unit”, which either succeeds completely or fails completely.[1] This is similar to what happens when we fail to install something on our laptop. If an error occurred, no matter at the 1% or the 99% of the processing bar, every installation would be rolled back. This means a single transaction only runs in a whole. If the transaction contains actions related to multiple entities, every action will be consistently done; one action’s failure means the whole transaction never happened. 

Because of the transaction’s atomicity, the database will have the property of consistency. This is saying that after the creation of a database with only entities and attributes and without any data, i.e. this is an empty database, the database has been ensured to be integrated as a whole database. Then, both before and after a transaction was updated, the database will remain the integration, which means the wholeness of the database would be invariant. This property prevents illegal transactions.

Transaction isolation determines how transaction integrity is visible to other users and systems.[2] It guarantees the database management system to be able to handle concurrency controls by setting different isolation levels. The precedence of isolation levels is a big topic to study. I will leave this topic for now. Lastly, a database needs to be durable, which means two things. First, after each transaction is processed, the update to the data in this database is permanent. Second, this update will be recorded by the database management system and shouldn’t be lost under any circumstances.

In general, the study of transactions and the set of properties allow us to remember the importance behind database design. Personally, I would highly recommend everybody to revisit these concepts before starting a system design.