0% found this document useful (0 votes)
11 views

Oop Reviewer

The document discusses various Java concepts like data types, operators, control flow statements, arrays and more. It provides examples and explanations of object-oriented programming principles, Java features and how to write Java code.

Uploaded by

brylla montero
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views

Oop Reviewer

The document discusses various Java concepts like data types, operators, control flow statements, arrays and more. It provides examples and explanations of object-oriented programming principles, Java features and how to write Java code.

Uploaded by

brylla montero
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

OBJECT-ORIENTED PROGRAMMING LONG

 Deals about creating object that contain  Larger than int


both data and functions  Ex. Long example = 200000000000000;

FOUR PILLARS OF OOP FLOAT


 Abstraction  Numbers with floating points
 Encapsulation  Ex. Float example = 200.78f;
 Inheritance
 Polymorphism DOUBLE
 Larger numbers with floating points
JAVA  Ex. Int example = 3.14159;
 Is a popular programming language
(previously named as Oak) OPERATORS
 Created in 1995  Are used to perform operations on
 Owned by oracle variables and values

JAVA NETBEANS EXAMPLE OF JAVA OPERATORS


 is one of the most popular Java ADDITION
Environment for developing Java  Ex. A + B
applications
 the platform that you will to write your SUBTRACTION
Java code and applications  Ex. A - B

JAVA VIRTUAL MACHINE MULTIPLICATION


 Java’s popularly known runtime  Ex. A * B
environment
DIVISION
OBJECT  Ex. A / B
 Refers to the embodiment of a class
MODULO
SYSTEM.OUT.PRINTLN  Ex. A % B
 Used to print a line on the console
INCREMENT
DATA  Increases the current value by 1
 an important part of programming and  Ex. A++
programs work by operating on data  Ex. A + 1

VARIABLE DECREMENT
 The name of the data and its value is  decreases the current value by 1
referred to as  Ex. A--
 Ex. A - 1
CHAR
 Characters SCANNER VARIABLES
 Ex. Char example = E;  nextInt()
 nextFloat()
BOOLEAN  nextDouble()
 True or False  nextShort()
 Ex. Boolean example = true;  nextLong()
 next().charAt(0)
INT  nextBoolean()
 Whole numbers  nextLine()
 Ex. Int example = 25;
ASCII CODES:
SHORT  65 to 90 = A to Z
 Smaller than int  97 to 122 = a to z
 Ex. Short example = 25;
IF STATEMENT
 Executes the code only if the condition !
specified is met  not

WHILE LOOP DO WHILE LOOP


 Iterates through a block of code as long as  Repitition is achieved by doing or
a specified condition is true executing the statement in the loop first,
before checking the condition
FOR LOOP NESTED LOOPS
 Is used if you know exactly the number of  It is when another loop exists in the body
times you want to loop though a block of of another loop
code
 Ex. For(int ctr = 1; cta <= up_bound; ctr++) BREAK
 Terminates the loop imediately
SWITCH
 Allows a variable to be tested for its CONTINUE
equality against a list of values  It moves to the end of the iteration and
then the test expression is evaluated, and
THREE COMPONENTS OF FOR LOOP: the update statement is evaluated in case
INITIALIZER of the for loop
 Which is one executed at the start of the
loop RETURN
 Ex. “ for(int ctr = 1; ”  Used to return a value inside a method

CONDITION ARRAY
 Which behaves similarly with how the  Is a collection of entities with similar types
condition in the while loop behaves  Ex. Int example[];
 Ex. “ctr <- up_bound; ”  Ex. Int[] example;

ITERATOR DYNAMIC MEMORY


 Which performs the updates on certain  Refers to the memory allocated to the
variables that were used in the loop program while it is running
 Ex. “ ctr++) ”
MULTI-DIMENSIONAL ARRAY
COMPARISON OPERATORS  Is an array of arrays
>  Ex. String[][] example;
 Is greater than  Ex. String example[][];

< ARRAYCOPY
 Is less than  A method available in the system class that
can be used to copy data from one array to
>= another efficiently
 Is greater than or equal to
LENGTH
<=  To establish the number of position in the
 Is less than or equal to array

LOGICAL OPERATORS
&&
 And

||
 Or

==
 Has a value of
POSSIBLE TRUE OR FALSE QUESTIONS 16. !(!(!(!(!(TRUE && FALSE)))))
1. Java is a case-insensitive language = TRUE
= TRUE
CHARCATER 17. !(!(FALSE || TRUE) && (TRUE && TRUE))
2. A String literal must be enclosed in single = TRUE
quotes (')
= FALSE 18. Java is short for JavaScript
= FALSE
3. The ++ operator increments a variable by 1
before evaluation 19. In java, its possible to inherit attributes and
= FALSE methods from one class to another
= TRUE
4. Java allows multiple inheritance of classes similar
= FALSE 20. Array is a collection of entities of different
types
5. The && operator (and) returns true only if = FALSE
both operands are true
= TRUE 21. testExpr = ((8 + 4 == 4 + 8));
= TRUE
6. For an OR operator to return true, only one
input/operands should be true 22. testExpr = ((39/3 == 13) && (56 % 6 == 0) ||
= FALSE ((2 + 8) == (8 + 2)));
= TRUE
7. Java supports break and continue statements
within nested loops 23. methodName() is the right way to create a
= TRUE method in Java
= TRUE
8. The first element in an array is 1
= FALSE

9. The increment (++) and decrement (--)


operators can be used in both prefix and postfix
forms, but the behavior is different
= TRUE

10. Java source code files can have different


name from the class they contain
= FALSE

11. Int is the variable you use to store a float


= FALSE

12. You can declare the variable after the


variable name
= FALSE
//
13. You use # to insert comments in Java
= FALSE
BREAK
14. Stop is used to stop a program
= FALSE
Sysmtem.out.println
15. Print(“Ang cute ng katabi ko”) is the right
syntax when printing in Java
= FALSE

You might also like