logo

Crowdly

TEB1043:Object Oriented Programming - January 2025

Looking for TEB1043:Object Oriented Programming - January 2025 test answers and solutions? Browse our comprehensive collection of verified answers for TEB1043:Object Oriented Programming - January 2025 at ulearn.utp.edu.my.

Get instant access to accurate answers and detailed explanations for your course questions. Our community-driven platform helps students succeed!

Which of the following Java classes is an abstract class?

0%
100%
0%
0%
View this question

Consider the Java program below. Choose an INVALID statement than cannot be added in the place of "// A line to be added" in the main method.

class testing {

public final void m1() {

System.out.println("Hey!");

}

public static void m2() {

System.out.println("Salam sejahtera");

}

}

public class Quiz2Q9 extends testing {

public static void main(String[] args) {

// A line to be added

}

0%
0%
100%
0%
View this question
Suppose a class has a method that is declared as final in a Java program. Which of the following statements is FALSE?

0%
100%
0%
0%
View this question

Which of the following statements about Java language is FALSE?

0%
0%
100%
0%
View this question

If class A inherits class B then class A is called the ___________.

100%
0%
0%
0%
View this question

Suppose you have two classes called Flight and Passenger. What is the best relationship you can create between the two classes?

100%
0%
0%
0%
View this question
Which of the following is FALSE about enumerated data type?

0%
0%
100%
0%
View this question

Which line indicate AUTOUNBOXING in the code snippet below?

ArrayList<Double> grades = new ArrayList<Double>();

grades.add(3.2); // Line 1

grades.add(2.7); // Line 2

double sum = 0.0; // Line 3

for (int i=0; i < grades.size(); i++) {

sum += grades.get(i); // Line 4

System.out.println("Sum = " + sum);

}

0%
100%
0%
0%
View this question
Which of the following is TRUE about ArrayList?

100%
0%
0%
0%
View this question

What will be the output of the program below?

import java.util.ArrayList;

public class Quiz2Q2 {

public static void main(String[] args) throws Exception {

ArrayList<Integer> arr = new ArrayList<>(); // 1

arr.add(100); // 2

System.out.println(arr.get(arr.size())); // 3

}

}

100%
0%
0%
0%
View this question

Want instant access to all verified answers on ulearn.utp.edu.my?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!