Hi Java Students! Thank you to all those who attend today's Java Programming class. We would like to clarify some parts of today's class:
A completed (and working) example of our code is located here: https://repl.it/@AKumar/CarClassWeek3#Main.java. All the code in the presentation is correct and does work in repl. In class, we made some minor mistakes that led to some major errors while running. Again, all the code in the presentation and the linked file is correct.
We mentioned the use of 'this' in class. Please note that 'this' is only to be used when you pass is a parameter that has the same name as a field in your class. This usage is demonstrated in the Parametrized constructor in the linked code
All classes must be present in separate files from each other (hence the Main.java and Car.java)
About repl: Repl will always run the main method in the Main.java file. This is not always the case in Java, In class, we demonstrated putting a main method in the Car class. This is not wrong. However, repl disregards the main method in our class and therefore gives us errors (as seen in class)
Thanks to all those who attended today's class. Please understand that we are trying our best to teach you all as much as we can with as little mistakes as possible. Errors in today's class were surely made and we ensure this won't happen again. Again, thank your for joining today's class and please look at the above comments for clarifications. We will be going over classes for the next few classes to clarify it. Lastly, don't be afraid to ask questions in class or on the forum; we will always do our best to answer you.