Quiz #3
Quiz #3
QUIZ #3:
4. What feature of Java which programs are not required to delete objects allocated in the
memory?
Garbage Collection
5. What feature of Java which programs developed can run on any computer system with no
changes long as JRE is installed in the computer?
Portable and Platform-Independent
RESEARCH
1. Five (5) example of high-level programming languages (not mentioned in this module)
and its features.
Delphi - is a software product that uses the Delphi dialect of the Object Pascal
programming language and provides an integrated development environment for
rapid application development of desktop, mobile, web, and console software,
currently developed and maintained by Embarcadero Technologies.
Literal is a source code representation of a fixed value. They are represented directly in the code
without any computation. Literals can be assigned to any primitive type variable. Java Literals
can be classified into six types, as below:
Integral Literals
Floating-point Literals
Char Literals
Boolean Literals
Null Literals
Data types are those which specify the type of data represented by the variable and literal is the
that is stored in to the variable. Data types are divided into two groups:
Primitive data types - includes byte, short, int, long, float, double, boolean and
char
Non-primitive data types - such as String, Arrays and Classes (you will learn
more about these in a later chapter)
QUIZ #4:
I. MODIFIED TRUE OR FALSE. Write the word TRUE if the statement is correct and if
otherwise change the underlined word/s to make the statement correct.
1. Trace the output program. Write your answer inside the box.
System.out.println(s);
System.out.print(“Welcome to ”);
System.out.println(“Java Programming!”);
System.out.print(“_*_*_*_*”);
}
}
RESEARCH
Please do research on the following. Write it in a clean short bond paper.
1. Arithmetic Operators
Arithmetic operators are used to perform arithmetic operations on variables and data. For
example,
a + b;
Here, the + operator is used to add two variables a and b. Similarly, there are various other
Operator Operation
+ Addition
- Subtraction
* Multiplication
/ Division
% Modulo
Operation
(Remainder
after division)
Assignment operators are used in Java to assign values to variables. For example,
int age;
age = 5 ;
Here, = is the assignment operator. It assigns the value on its right to the variable on its left.
Operat Examp
Equivalent to
or le
= a = b; a = b;
+= a += b; a = a + b;
-= a -= b; a = a - b;
*= a *= b; a = a * b;
/= a /= b; a = a / b;
a %=
3. %= a = a % b; Logical Operators
b;
Operat Example Meaning
or
Logical operators are used to check whether an expression
""(Logi expressi true only if
cal on1 both
AND) ""expres expression1 is true or false. They are used in decision making.
sion2 and
expression2
are true
|| || true if
(Logica expressi either
l OR) on2 expression1
or
expression2
is true
! ! true if
(Logica expressi expression
l NOT) on is false and
vice versa