Search This Blog

Friday, January 14, 2011

Java Neurons: Remember Me


                 Java Neurons: Remember Me- Time to pump some neurons
1.    Statement end in semicolon;
2.    Code blocks are defined by a pair of curly braces {}
3.    Declare an int variable with a name and a type and a type:  int x;
4.    The  assignment operator  is one euals sign =
5.     A while loop run everything within its block (defined by curly braces) as long as the conditional test is  true
6.    If the conditional test is false, the while loop code block won’t run, and execution will move down to the code immediately after the loop block.
7.    Put a Boolean test inside parentheses:  while   (x  ==  4)  {   }
8.    When you design a class, think about the objects that will be created from that class type. Think about:  things the object knows,     things the object does
9.    Things an object knows about itself are called instance variable.
10.                       Things an object can do are called method.
11.                       A class in not an object. ( but it’s used to construct them). A class is a blueprint fpr an object. It  tell the JVM how to make an object of that particular type. Each object made from that class can have its own value for the instance variable of that class.
12.                       As long as you’r in main(), you’r not really in Objectville. It’s fine for test program to run within the main method, but in a true OO  application, you need object talking to other objects, as opposed to a static main() method creating and testing object.
13.                       The two uses of main:  to test your real class.     To launch/start your java application
14.                       Object-oriented programming lets you extend a program without having to tuch previously-tested, working code.
15.                       All java code is define in a class
16.                       A class describes how to make an object of that class type. A class is like blueprint.
17.                       An object can take care of itself; you don’t have to know to care how the object does it.
18.                       An object knows about itself are called instance variable.  They represent the state of an object.
19.                       Thing an object does are called   method. They represent the behavior of an object.
20.                       When you create a class, you may also want to create a separate test class which you’ll use to create object of your new class type.
21.                       A class can inherit  instance variables and methods from a more abstract superclass.
22.                       At runtime, a java program is nothing more than object ‘talking’ to other objects.
23.                       Variable come in two flavors: permitive and reference. It must always be declared with a name and a type.
24.                       A primitive variable value is the bits representing the value (5, ‘a’, true, 3.1416, etc).
25.                       A reference variable value is the bits representing a way to get to an object on the heap.
26.                       A reference variable is like a remote control. Using the dot operator(.) on a reference variable is like pressing a button on the remote control to access a method or instance variable.
27.                       A reference variable has a value of null when it is not referencing any object.
28.                       An array is always an object, even if the array is declared to hold primitives, there is no such thing as a primitive array, only an array that hold primitives.

No comments:

Post a Comment