LaunchCodeEducation / skills-back-end-java

Unit 3 (Java Track) of the LC101 Curriculum, following fundamentals in Python
http://education.launchcode.org/skills-back-end-java/
Other
16 stars 31 forks source link

Errata: http://education.launchcode.org/skills-back-end-java/java4python/data-types/ #2

Closed ribex closed 7 years ago

ribex commented 7 years ago

parameter: We only need to specify the type of a variable or paremeter when declaring it. Subsequent usage does not require specifying the type, and will result in an error.

implicitly: This process is called autoboxing. In this book we will typically use the Object version of all the numeric data types and let the compiler do its thing, implicitely converting values to a primitive type whenever necessary.

celsius: several occurrences of celsuis

let's: Next, lets look at the Java Equivalent.

Java and: In pure object-oriented langauges like Javaand C#

dissected: We've already disected each element of this line, however, we haven't really shown you how you might create your own methods in other contexts.

switch Hello World and Hola Mundo:

public class Message {

    public static String getMessage(String lang) {

        if (lang.equals("sp")) {
            **return "Hello World";**
        } else if (lang.equals("fr")) {
            return "Bonjour le monde";
        } else {
            **return "Hola Mundo";**
        }
    }
}

its: Note that it does not have a main method, so it can't be run on it's own.

class in: To call a static method we must use the name of the classin which it is defined, followed by ., followed by the name of the method.

chrisbay commented 7 years ago

Fixed in 433a636d8658dfce54547ed999bde1a67661b23d