0% found this document useful (0 votes)
245 views19 pages

ITE6104 Computer Programming 2 (Final Exam)

This document provides a final exam for the course ITE6104 Computer Programming 2. It contains 8 multiple choice questions about Java programming concepts like Java source code extensions, method names, array lengths, features of Java, runtime errors, the function of the Java Virtual Machine (JVM), compiling Java programs, and valid return values for the nextDouble() method. The questions test understanding of core Java programming topics covered in the course.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
0% found this document useful (0 votes)
245 views19 pages

ITE6104 Computer Programming 2 (Final Exam)

This document provides a final exam for the course ITE6104 Computer Programming 2. It contains 8 multiple choice questions about Java programming concepts like Java source code extensions, method names, array lengths, features of Java, runtime errors, the function of the Java Virtual Machine (JVM), compiling Java programs, and valid return values for the nextDouble() method. The questions test understanding of core Java programming topics covered in the course.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 19

8/4/2021 Help for Education: ITE6104 Computer Programming 2 ( Final Exam )

Aral-aral din. Wag kang Tamad!

Home Free Courses Computer Shortcut Keys PDF Contact Us

Treat Me WHA

Popular Posts

Web Application
Development
IT6314 Web Application
Development 1 (Final
Q1, Q2 & Final Exam)

Life and Works of Jose


Rizal
Life and Works of Jose
Rizal As mandated by
Republic Act 1425, this ITE6104 Computer Programming 2 ( Final Exam )
course covers the life and works of
the country's foremost national ... ITE6104 Computer Programming 2 ( Final Exam )
Information
Management
ITE6220-Information
Management (Final Q1,
Q2 & Final Exam)

PHYED-6101 Physical Fitness


PHYED-6101 Physical Fitness
Health refers to a state of complete
physical, mental, and social well-
being and not merely an absence or
presen...

Team Sports (
Complete )
Team Sports

Question 1
Answer saved

Marked out of 2.00

Flag question

What is the extension name of a Java Source code?

Select one:
a.
j

b.
class

c.
java

d.
None of the choices

e.
javac
Register for the
Clear my choice
Level I CFA® exam.

https://www.amaoedleaks.com/2021/02/ite6104-computer-programming-2-final.html 1/19
8/4/2021 Help for Education: ITE6104 Computer Programming 2 ( Final Exam )

Question 2
Answer saved

Marked out of 1.00

Flag question

What is the name of this method: int test(){return 1;} ?

Select one:
a.
int

b.
7

c.
6

d.
test

Clear my choice

Question 3
Answer saved

Marked out of 1.00

Flag question

What is the length of the array: int[] intArray = { 1, 2, 3, 5, 6, 7 };

Select one:
a.
7

b.
6

c.
4

d.
5

Clear my choice

Question 4
Answer saved

Marked out of 1.00

Flag question

The Java feature, "write once, run anywhere", is termed as

Select one:
a.
Robust

b.
High Performance

c.
Register for the Object Oriented
Level I CFA® exam.
d.

https://www.amaoedleaks.com/2021/02/ite6104-computer-programming-2-final.html 2/19
8/4/2021 Help for Education: ITE6104 Computer Programming 2 ( Final Exam )
Platform independent

Clear my choice

Question 5
Answer saved

Marked out of 1.00

Flag question

Which of the following is true about Runtime errors

Select one:
a.
All of the choices

b.
Runtime errors occur when there is a design flaw in your program

c.
Runtime errors occur during run-time.

d.
Runtime errors occur after compilation.

Clear my choice

Question 6
Answer saved

Marked out of 1.00

Flag question

What is the function of JVM?

Select one:
a.
Interpreting bytecode

b.
Generating bytecode

c.
Reading bytecode

Clear my choice

Question 7
Answer saved

Marked out of 1.00

Flag question

What is the correct statement to compile Java program in command line?

Select one:
a.
java HelloWorld.java

b.
javac HelloWorld.java

c.
Register for the java HelloWorld
Level I CFA® exam.
d.

https://www.amaoedleaks.com/2021/02/ite6104-computer-programming-2-final.html 3/19
8/4/2021 Help for Education: ITE6104 Computer Programming 2 ( Final Exam )
javac HelloWorld

Clear my choice

Question 8
Answer saved

Marked out of 1.00

Flag question

Which of the following is a valid nexDouble() return value?

Select one:
a.
12.0

b.
3.1416

c.
double value

d.
floating-point literal

e.
All of the choices

Clear my choice

Question 9
Answer saved

Marked out of 1.00

Flag question

What will be the output if you execute this code:


int a[] = new int[1];
System.out.println(a[1]);

Select one:
a.
It will display nothing.

b.
It will produce an exception.

c.
It will display “a[1]”.

d.
It will display the value of a[1].

Clear my choice

Question 10
Answer saved

Marked out of 1.00

Flag question

What was the initial name of the Java programming language?


Register for the
Level I CFA exam.
®
Select one:

https://www.amaoedleaks.com/2021/02/ite6104-computer-programming-2-final.html 4/19
8/4/2021 Help for Education: ITE6104 Computer Programming 2 ( Final Exam )
a.
Oak

b.
NetBeans

c.
C

d.
Javad

e.
None of the choices

Clear my choice

Question 11
Answer saved

Marked out of 1.00

Flag question

Which of the following shows Overloading method?

Select one:
a.
void test(){} void test(){}

b.
All of the Choices

c.
void test(int x){} void test(double x){}

d.
. void test(int x){} void test(int y){}

Clear my choice

Question 12
Answer saved

Marked out of 1.00

Flag question

What did java generates after compiling the java source code?

Select one:
a.
Byte Code

b.
Class Code

c.
None of the choices

d.
Image file

e.
Executable file

Clear my choice

Question 13
Register for Answer
the saved
Level I CFA® exam.
Marked out of 1.00

https://www.amaoedleaks.com/2021/02/ite6104-computer-programming-2-final.html 5/19
8/4/2021 Help for Education: ITE6104 Computer Programming 2 ( Final Exam )
Flag question

Which of the following class declaration is not allowed to be inherited?

Select one:
a.
class Person{}

b.
public final class Person {}

c.
public abstract class Person {}

d.
public class Person {}

Clear my choice

Question 14
Answer saved

Marked out of 1.00

Flag question

What will be the output if you execute this code?


do{
System.out.println("Hello World!");
}
while(true);

Select one:
a.
Do nothing

b.
print "Hello World"

c.
print "Hello World" infinitely

d.
The code will not run because of syntax error

Clear my choice

Question 15
Answer saved

Marked out of 1.00

Flag question

Which of the following is a valid identifier?

Select one:
a.
public

b.
static

c.
Register for the name
Level I CFA® exam.
d.
true

https://www.amaoedleaks.com/2021/02/ite6104-computer-programming-2-final.html 6/19
8/4/2021 Help for Education: ITE6104 Computer Programming 2 ( Final Exam )

e.
None of the choices

Clear my choice

Question 16
Answer saved

Marked out of 2.00

Flag question

The feature of Java which makes it possible to execute several tasks simultaneously.

Select one:
a.
Multithreaded

b.
Platform independent

c.
None of the choices

d.
Robust

e.
Code Security

Clear my choice

Question 17
Answer saved

Marked out of 1.00

Flag question

Which of the following scenarios where an exception may occur?

Select one:
a.
All of the choices

b.
A user has entered an invalid data.

c.
A network connection has been lost in the middle of communications or the JVM has run
out of memory.

d.
A file that needs to be opened cannot be found.

Clear my choice

Question 18
Answer saved

Marked out of 1.00

Flag question

Which of the following is the correct syntax to define a method?

Select one:
a.
Register for the <packageName> package;
Level I CFA® exam.
b.

https://www.amaoedleaks.com/2021/02/ite6104-computer-programming-2-final.html 7/19
8/4/2021 Help for Education: ITE6104 Computer Programming 2 ( Final Exam )
package <packageName>;

c.
<modifier> package <packageName>;

d.
<packageName>;

Clear my choice

Question 19
Answer saved

Marked out of 1.00

Flag question

Which of the following is a valid editor for java source code?

Select one:
a.
NetBeans

b.
eclipse

c.
All of the choices

d.
BlueJ

e.
Notepad

Clear my choice

Question 20
Answer saved

Marked out of 1.00

Flag question

It is the method of hiding certain elements of the implementation of a certain class?

Select one:
a.
Encapsulation

b.
Class

c.
Object Oriented

d.
Object

e.
None of the choices

Clear my choice

Question 21
Answer saved

Marked out of 1.00

Flag question
Register for the
Level I CFA® exam.
Which of the following is true about syntax errors:

https://www.amaoedleaks.com/2021/02/ite6104-computer-programming-2-final.html 8/19
8/4/2021 Help for Education: ITE6104 Computer Programming 2 ( Final Exam )
Select one:
a.
All of the above.

b.
Incorrect capitalization leads to syntax error.

c.
Syntax errors are usually typing errors.

d.
You will have syntax errors if you misspell the Java command.

e.
None of the choices

Clear my choice

Question 22
Answer saved

Marked out of 1.00

Flag question

It is used to access the instance variables shadowed by the parameters.

Select one:
a.
mutator method

b.
accessor method

c.
method

d.
this

Clear my choice

Question 23
Answer saved

Marked out of 1.00

Flag question

what will be the output if you execute this code?


int x=2;
switch(x){
case 1:
System.out.print(“1”);
case 2:
System.out.print(“1”);
case 3:
System.out.print(“1”);
default:
System.out.print(“1”);
}

Select one:
a.
display 1234

Register for the b.


Level I CFA® exam.
display 1

https://www.amaoedleaks.com/2021/02/ite6104-computer-programming-2-final.html 9/19
8/4/2021 Help for Education: ITE6104 Computer Programming 2 ( Final Exam )
c.
display 111

d.
display 1111

Clear my choice

Question 24
Answer saved

Marked out of 1.00

Flag question

What do you call a blueprint of an object?

Select one:
a.
Class

b.
Object

c.
Method

d.
one of the choice

e.
Constructor

Clear my choice

Question 25
Answer saved

Marked out of 1.00

Flag question

What is the return value of this method: int test(){return 1;} ?

Select one:
a.
1

b.
int

c.
return 1

d.
test

Clear my choice

Question 26
Answer saved

Marked out of 1.00

Flag question

What is the index number of the last element of an array with 20 elements?
Register for the
Level I CFA® exam.
Select one:
a.
https://www.amaoedleaks.com/2021/02/ite6104-computer-programming-2-final.html 10/19
8/4/2021 Help for Education: ITE6104 Computer Programming 2 ( Final Exam )
None of the choices

b.
19

c.
21

d.
0

e.
20

Clear my choice

Question 27
Answer saved

Marked out of 1.00

Flag question

What is the output of the code snippet below:


int[] intArray = { 1, 2, 3, 5, 6, 7 };
for(int x = intArray.length-1; x>=0; x--){
System.out.print(intArray[x]);
}

Select one:
a.
12356

b.
765321

c.
123567

d.
The given code is not valid

Clear my choice

Question 28
Answer saved

Marked out of 1.00

Flag question

From the array int[] intArray = { 1, 2, 3, 5, 6, 7 };, what is the value of intArray[2]?

Select one:
a.
2

b.
1

c.
3

d.
4

Register for the Clear my choice


Level I CFA® exam.

https://www.amaoedleaks.com/2021/02/ite6104-computer-programming-2-final.html 11/19
8/4/2021 Help for Education: ITE6104 Computer Programming 2 ( Final Exam )

Question 29
Answer saved

Marked out of 1.00

Flag question

Which of the following does not return numeric value?

Select one:
a.
nextLong()

b.
nextDouble()

c.
nextShort()

d.
None of the choices

e.
nextInt()

Clear my choice

Question 30
Answer saved

Marked out of 1.00

Flag question

What is the maximum index of the array:


int[] intArray = { 1, 2, 3, 5, 6, 7 };

Select one:
a.
4

b.
5

c.
7

d.
6

Clear my choice

Question 31
Answer saved

Marked out of 1.00

Flag question

Which of the following is not a java keyword?

Select one:
a.
None of the choices

b.
Register for the goto
Level I CFA® exam.
c.

https://www.amaoedleaks.com/2021/02/ite6104-computer-programming-2-final.html 12/19
8/4/2021 Help for Education: ITE6104 Computer Programming 2 ( Final Exam )
name

d.
else

e.
if

Clear my choice

Question 32
Answer saved

Marked out of 1.00

Flag question

Which of the following is a valid statement to accept int input? Let us assume that we have declared
scan as Scanner.

Select one:
a.
int num = scan.nextLong();

b.
int num = scan.nextInt();

c.
short num = scan.nextShort();

d.
int num = scan.getInt();

Clear my choice

Question 33
Answer saved

Marked out of 2.00

Flag question

Which of the following is true about constructor?

Select one:
a.
Constructors have the same name as the class

b.
Constructors does not have any return value

c.
All of the choices

d.
It can only be called by using the new operator during class instantiation.

Clear my choice

Question 34
Answer saved

Marked out of 1.00

Flag question
Register for the
Level I CFA® exam.

https://www.amaoedleaks.com/2021/02/ite6104-computer-programming-2-final.html 13/19
8/4/2021 Help for Education: ITE6104 Computer Programming 2 ( Final Exam )

What is floating-point literal?

Select one:
a.
Can be express in scientific notation.

b.
An integer literal with decimal point.

c.
It could be double or float value.

d.
All of the choices

e.
By default it is double type.

Clear my choice

Question 35
Answer saved

Marked out of 1.00

Flag question

What is the correct statement to run Java program in command line?

Select one:
a.
javac HelloWorld

b.
java HelloWorld

c.
java HelloWorld.java

d.
javac HelloWorld.java

Clear my choice

Question 36
Answer saved

Marked out of 1.00

Flag question

What is the output of the code snippet below:


void main(){test(1.0);
test(1);}
void test(double x){
System.out.print(x);
void test(int x){System.out.print(x);}

Select one:
a.
11

b.
1.01.0

c.
Register for the 1.0
Level I CFA® exam.
d.
https://www.amaoedleaks.com/2021/02/ite6104-computer-programming-2-final.html 14/19
8/4/2021 Help for Education: ITE6104 Computer Programming 2 ( Final Exam )
1.01

Clear my choice

Question 37
Answer saved

Marked out of 1.00

Flag question

What will be the value of x after executing this code for(int x=0; x<=11; x++) {} is run?

Select one:
a.
12

b.
10

c.
11

d.
1

Clear my choice

Question 38
Answer saved

Marked out of 1.00

Flag question

What will be the value of x after you execute this statement


int z=0;
for(int x=0; x<10; x++)
for(int y=0; y<x; y++) z*=(x*y);

Select one:
a.
1

b.
512

c.
236

d.
None of the Choice

e.
128

Clear my choice

Question 39
Answer saved

Marked out of 2.00

Flag question

Register for the


Level I CFA® exam.
What keyword is used to perform class inheritance?

https://www.amaoedleaks.com/2021/02/ite6104-computer-programming-2-final.html 15/19
8/4/2021 Help for Education: ITE6104 Computer Programming 2 ( Final Exam )
Select one:
a.
implements

b.
inherits

c.
derives

d.
None of the choices

e.
extends

Clear my choice

Question 40
Answer saved

Marked out of 1.00

Flag question

Which of the following shows a valid Overloading method?

Select one:
a.
void test(){} void test(){}

b.
void test(char x, int y){} void test(int x, char y){}

c.
All of the Choices

d.
void test(int x){} void test(int y){}

e.
None of the choices

Clear my choice

Question 41
Answer saved

Marked out of 1.00

Flag question

Which of the following is not a valid Float value?

Select one:
a.
3.4028235E+38F

b.
all of the choices

c.
1.2345E+3

d.
2.23

e.
12345678910F
Register for the
Level I CFA® exam.
Clear my choice

https://www.amaoedleaks.com/2021/02/ite6104-computer-programming-2-final.html 16/19
8/4/2021 Help for Education: ITE6104 Computer Programming 2 ( Final Exam )

Question 42
Answer saved

Marked out of 1.00

Flag question

What is the result if we execute this: “a”.equals(“a”);?

Select one:
a.
true

b.
false

c.
“a”

d.
The code is not valid

Clear my choice

Question 43
Answer saved

Marked out of 1.00

Flag question

It used to read values from class variables?

Select one:
a.
Method

b.
Accessor

c.
Instance Variable

d.
Mutator

e.
None of the choices

Clear my choice

Question 44
Answer saved

Marked out of 2.00

Flag question

Which of the following is not a primitive data type?

Select one:
a.
long

b.
short

Register for the c.


byte
Level I CFA® exam.

https://www.amaoedleaks.com/2021/02/ite6104-computer-programming-2-final.html 17/19
8/4/2021 Help for Education: ITE6104 Computer Programming 2 ( Final Exam )
d.
none of the choices

e.
String

Clear my choice

Question 45
Answer saved

Marked out of 1.00

Flag question

Which of the following is a valid multidimensional array?

Select one:
a.
int[][] intArray;

b.
All of the choice

c.
int[][][] intArray;

d.
int[][][][] intArray;

e.
int intArray[][][];

Newer Post Home Older Post

Register for the


Level I CFA® exam.

https://www.amaoedleaks.com/2021/02/ite6104-computer-programming-2-final.html 18/19
8/4/2021 Help for Education: ITE6104 Computer Programming 2 ( Final Exam )

The information provided in or through this website is for educational


and informational purposes only and solely as a self-help tool for your
own use.

Powered by Blogger.

Register for the


Level I CFA® exam.

https://www.amaoedleaks.com/2021/02/ite6104-computer-programming-2-final.html 19/19

You might also like