Sunday, April 10, 2016

Practicing Java


Working through more tutorials on java. The first tutorial explained how to define variables. In the tutorial variables are described as boxes. In java there are different types of boxes. Depending on the type you must use a key word behind the variable. For example if your variable is an integer you must put, int variable name = integer. Then using sysout you can run the program and it will output your integer in the console. Other key words include, char for charcter, boolean for true/false, and float for a floating number. When initializing a float you must put f at the end of the float. In the following tutorial I went over classes. A class is just a type, for example a dog is a type of animal. In the tutorial we used the class string which is a type of object that can hold text. The variable in a string allows you to refer to a thing that has the type string. What you set the variable equal to is called the object. An object is a particular instance of a class. For example if the class was a dog an example of an object would be an German Shepherd.

No comments:

Post a Comment