Itpf Reviewer
Itpf Reviewer
Itpf Reviewer
Java was created in 1995, by James Gosling, while he was working at Sun
Microsystems
First public release was in 1996.
Object/s – Is an instance of a class, representing a specific entity with its own state
and behavior in a program
Class – Is a blueprint that defines the structure and behavior of (attribute and
methods) of objects.
Attribute – are the data or properties associated with a class, defining the state or
characteristics of objects are created from that class(?) that’s what my notes say
LMAO
Instance Variable – is a variable defined in a class for which each object of the
class has its own unique copy, representing the object’s state.
Security
Due to obstructions in OOPs, data hiding is possible and hence its more secure than
POPs
Complexity
OOPs due to modularity in its programs it is les complex and hence new data
objects can be created easily from existing objects, making object oriented easy to
modify.
Class names – For all class names, the first letter should be in upper case. If
several words are used to form a name of the class, each inner word’s first letter
should be uppercase “MyFirstJavaClass”
Method names- All method names should start with a lower case letter. If several
words are used to form the name of the method, then each inner word’s first letter
should be in Uppercase. “myMethodName()”
No comment im lazy
Arrays-
Are objects that store multiple variables of the same type. However, an array itself
is an object.
Reserved words for Java.
Single line comments – they are used to comment on code, they use two forward
slashes (//) NOT (\\)
Multi-line comments – they start with /* and ends with */.
Any text between /* and */ will be ignored by Java.
Variable – can hold only one value at a time but it can change.
Just the same principle as the one we have for CC-103
- Classes – is a blueprint which incl- yeah this was said already at the
beginning of this reviewer come on.
3.1 PART II
Arithmetic Operations
- + Addition
- - Subtraction
- * Multiplication
- / Division
- % Remainder (modulus)
Operator Precedence
- INSTEAD OF PEMDAS we have Operator Precedence, refers to the rules for
the order in which parts of a mathematical expression are evaluated.
4 JOPTIONPANE CLASS
Dialog Boxes
- Is a small graphical window that displays a message to the user or requests
input.
- A variety or dialog boxes can be displayed using the JOptionPane Class
- Two of the dialog boxes are:
o Message Dialog – a dialog box that displays a message
o Input dialog – a dialog box that prompts the user for input.
o Integer.parseInt
o Short.parseShort
o Long.parseLong
o Float.parseFloat
o Double.parseDouble
o The public static void main is a method!!! Methods are just functions…
(in C++)
Adding parameters to Methods
- Arguments – are Data types you use in a call to a method.
o When the method receives the data items they are called
parameters. ( you can add more than one parameter )