0% found this document useful (0 votes)
3 views4 pages

Reviewer Java Nay Answer

Uploaded by

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

Reviewer Java Nay Answer

Uploaded by

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

Intvalue_int=20;

Stringvalue_string”Java”;

Doublevalue_double+23.53;

Sout(value_int);

Sout(value-int);

Sout(value_double);

Part I: Java Fundamentals

1. A variable declared inside the body of the method. It cannot be defined with the static
keyword
Answer: Local Variable

2. A variable declared inside the class but outside of the body of the method (and not
declared as static)
Answer: Instance Variable

3. A class-level variable
Answer: Static Variable (Class Variable)

4. It is a combination of "vary" and "able". It is a name of a reserved area allocated in


memory
Answer: Variable

5. Its value is instance-specific and is not shared among instances


Answer: Instance Variable

6. These are used to group all the commands together to ensure that the commands
belong to a class or a method
Answer: Code Block (using curly braces { })

7. ESCAPE wag ito isali


Answer: [Skipped]

8. ESCAPE wag ito isali


Answer: [Skipped]

9. It is used to refer to classes stored in other packages; it is always written after the
package statement and before any class declaration
Answer: Import Statement
10. It defines a namespace in which classes are stored. It must be the first line of your
program
Answer: Package Statement

11. This section is used to specify an interface in a Java program


Answer: Interface Declaration

12. A part of the documentation section which starts with a pair of forward slashes. For
example: // java program structure
Answer: Single-line Comment

13. A part of the documentation section which starts with /* and ends with */
Answer: Multi-line Comment

14. It is an optional section which is mainly used to implement multiple inheritance in Java
Answer: Interfaces

15. True or false: when the main method is declared public it means that it can be used
outside of the declared class as well
Answer: True

16. The first computer programmer


Answer: Ada Lovelace

17. When was Java created?


Answer: Java was created in the mid-1990s and officially released in 1995.

18. Who is the father of Java?


Answer: James Gosling

19. Who is the father of the computer?


Answer: Charles Babbage

20. The native language of the computer


Answer: Machine Language

21. One of the most important aspects in developing a computer program (dealing with
errors or bugs that need to be fixed)
Answer: Debugging

22. Refers to errors in a computer program


Answer: Bugs
23. A type of error which occurs due to the fact that the syntax of the language is not
respected
Answer: Syntax Error

24. A program design language that describes the steps of an algorithm using everyday
language
Answer: Pseudocode

25. It is a graphical representation of an algorithm using shapes and symbols


Answer: Flowchart

Part IV: Java Variables and Operators – Enumeration

1. Enumerate at least 5 primitive data types (using the common ones)


Answer:
A. int
B. double
C. boolean
D. char
E. float

2. Enumerate the two types of comments and give 1 example each


Answer:
a. Single-line Comment:

// This is a single-line comment

b. Multi-line Comment:

/* This is a multi-line comment*/

3. Enumerate the 3 types of variables


Answer:
A. Local Variables – Declared within methods.
B. Instance Variables – Declared in a class but outside any method; each object has its
own copy.
C. Class Variables (Static Variables) – Declared with the static keyword; shared by all
instances of the class.

4. Enumerate at least 5 operators in Java programming


Answer:
a. Arithmetic Operators:
b. Ternary Operators
c. Logical Operators:
d. Bitwise Operators:
e. Relational Operators:

part V.
pseudo code and flowchart write the pseudocode and the flowchart of the problem
below
1. Marie enters the store to buy some school supplies. The manage offered her 15%
discount for a minimum purchase of Php1500. Print the change of marie if she buys
the following
 Ballpen worth php100
 Markers worth php150
 Notebooks worth php200
 Intermediate papers worth php 200
 Bond papers woth 550

Pseudocode flowchart
1. Start
2. Read a,b,c,d,e
3. f = a+b+c+d+e Start
4. if F>=1500
5. d = F- ( F*15)
Read
6. read cash
a,b,c,d,e
7. total = cash – d
8. print total
9. end f=a+b+c+d+e

Readcash
D=f – (f*0.15)

Change = cash - Read cash


f

Total = cash - d
Print change

Print total

Stop

You might also like