What Is an Object?
Objects are key to understanding object-oriented technology. Real-world objects share two characteristics: They all have state and behavior.
Bundling code into individual software objects provides a number of benefits, including:
1- Modularity: The source code for an object can be written and maintained independently of the source code for other objects.
2- Information-hiding: By interacting only with an object's methods, the details of its internal implementation remain hidden from the outside world.
3- Code re-use: If an object already exists (perhaps written by another software developer), you can use that object in your program.
4- Pluggability and debugging ease: If a particular object turns out to be problematic, you can simply remove it from your application and plug in a different object as its replacement.
What Is a Class?
A class is the blueprint from which individual objects are created. The syntax of the Java programming language will look new to you, but the design of this class is based on the previous discussion of bicycle objects.
A class is the blueprint from which individual objects are created. The syntax of the Java programming language will look new to you, but the design of this class is based on the previous discussion of bicycle objects.
Declaring Classes
Class declarations can include these components, in order:
-
Modifiers such as public, private, and a number of others that you will encounter later.
-
The class name, with the initial letter capitalized by convention.
-
The name of the class's parent (superclass), if any, preceded by the keyword extends. A class can only extend (subclass) one parent.
-
The class body, surrounded by braces, {}.
Decimals
Every digit in a decimal number has a "position", and the decimal point helps us to know which position is which.
The Decimal Number System is also called "Base 10", because it is based on the number 10, with these 10 symbols: 0,1,2,3,4,5,6,7,8,9.
Binary Numbers
Binary Numbers are just "Base 2" instead of "Base 10". So you start counting at 0, then 1, then you run out of digits ... so you start back at 0 again, but increase the number on the left by 1.
Hexadecimal Numbers
They look the same as the decimal numbers up to 9, but then there are the letters ("A',"B","C","D","E","F") in place of the decimal numbers 10 to 15.
