Friday, February 13, 2015

ch 4

This chapter mostly talked about parameters and arguments, to return values, to encapsulation, to instance and local variables. Using the vocabulary "call" and "pass" refers to using a method within a particular reference object, and inputing a value where applicable.
Arguments are passed into methods, and are also parameters  which is a local variable. If a method takes a parameter, it must have something passed to it. Instance variables will always get a default value; if a value is not assigned, it will default to one of four values, depending on the type. Local variables are declared within a method, and must be initialized before use, or else it will not compile.Instance variables are declared within a class,


Initializing an instance variable is done through giving the variable an intial value, and that a referenced instance variable will return the default values of null if it is a string or 0 if it is an integer variable.

Wednesday, January 28, 2015

ch 3

This chapter was all about variable types and their functions. It helped to distinguish between objects and classes. I learned that Java reads all the class definitions before executing public static void mainThe four integer variables are byte, short, int, and long. They can hold 8 bits, 16 bits, 32 bits, and 64 bits, respectively. They're all used for numerical values, but each are used depending on the size of the value. An important thing to note is that a good analogy for these numeric variables are different sized cups. You can redefine smaller values that fit into smaller types as bigger types, like how you can pour something from a small cup into a larger cup. an arry is like a tray of these cups. an array is like a remote control to the objects. this way they can control diffrent kinds of intigers. 

Tuesday, January 20, 2015

ch 2 post

in ch 2 we leaned a lot about objects and how they work with classes, intences, and methods. there is a real class whose objects we wont to use and theirs tester classes that test for objects. classes can inherit instance variables. in this chapter they put us thought an interesting scenario of two guys writing the same code but in different ways to show the difference with methods.we learned how the classes can be broken down in to super classes and sub classes. super classes are more abstract when sub classes are more spicfic to the method being performed. they started to talk more about OO programming and what was effective about it. objects can also be able to executed task given to them to preform differently.

Tuesday, January 13, 2015

ch 1 post

we learned about conditional branching. in this chaperter we learned about looping and boolean test. A simple boolean test is < less than, > greater than, == equality. loops can be created by using while and do-while's. the line will keep looping untill condision is completed. To practice what we learned we made the 99 bottles of beer activtiy. This tested out our boolean test we had to create a looping tester to make sure it would go to 1 and then stop and go down by 1 each time.

 beerNum = beerNum - 1

this makes the number go down by one.

(beerNum > 0)


this makes sure that the beer count cant go below 0.

beerNum == 99;

this sets the beer count to 99