
CompProg2 Midterm Assessment
Quiz by Maria Lolita Masangcap
Tag the questions with any skills you have. Your dashboard will track each student's mastery of each skill.
Using the String method char charAt(int index), what is returned when it is used?
What will happen if when a method is called?
Constructor creates an instance for the class.
Is the given statement TRUE? If yes, choose TRUE; otherwise, choose an answer that will replace the underlined word and will make the statement correct.
Given the program code in the image, what type of method is it?

Given the program code in the image, identify what is the constructor defined in it?

Given the program code in the image, identify what are the parameter/s in the program fragment numbered 3?

Analyze the given the program code below, construct the main function by identifying its syntax and program statements that will give a similar output presented here.

Kindly refer on the image for the string declarations. What will be the output of the statement below?
System.out.println(str3.charAt(10));

Kindly refer on the image for the string declarations. What will be the output of the statement below?
System.out.println(str3.indexOf("Pro"));

Kindly refer on the image for the string declarations. What will be the output of the statement below?
System.out.println(str3.substring(4, 11));

Evaluate the following statements about methods:
1) It is not a reusable part of computer program.
2) It can produce answer value (return value).
3) It can take in special inputs (parameters).
4) Its idea is similar to functions in mathematics.
Which of the following is not true about methods?
Examine the following methods:
1) String toUpperCase()
2) int compareTo(String s)
3) String substring(int startIndex)
4) boolean equals (String s)
Which of the given method/s return/s string values?
Evaluate the following statements about the ArrayList Class:
1) It is a resizable array.
2) It can be found in the java.util package.
3) It has a method remove() that is used to remove all elements in the array.
4) Elements declared of this class can be sorted in increasing order, alphabetically or numerically.
Which of the following is not true about ArrayList Class?
(1) ______________ itself does nothing but the real functionality is achieved through their (2) _______________.
Say that there are three classes: Employee, Non-Teaching, and Teaching. What are the likely relationships between these classes?
Which of the following is a correct syntax of defining a new class myIpad that inherits the parent class AppleDevice?
What type of inheritance is shown in the program code?

What type of inheritance is shown in the program code?

Evaluate the following statements about inheritance in Java:
1) Constructors of the parent class are inherited by child classes.
2) A child class in Java can only have one parent class.
3) A child class does not inherit the private members of its parent class.
4) Multiple inheritance is supported in Java.
Which of the following is not true about inheritance in Java?
Which of the following program fragment can implement the type of inheritance shown in the given image?

Which of the following statements is invalid?

A class Animal and its child class Bird both have a method animalSound(). If test is an object of the type Bird, what will the following code do?
test.animalSound()
Given the program code in the image, what will be displayed on the screen?

What type of polymorphism is achieved in the given program code?

If a class ClassKo inherits the given abstract class MyClass, what must be done in class ClassKo?

What is wrong with the given program fragment in the image?

Polymorphism happens when _____________________.
Can an object be a subclass of another object?
What is true about using the super keyword in a constructor?
In the given program code in the image, identify the variables that are encapsulated in the class and cannot be accessed by other classes.Â

Given the program code, what will be displayed on the screen?

In the given image, what step of object creation is represented by the statement inside the rectangle?

The tools provided by the AWT are implemented using each platform's native GUI; hence, preserving the look and feel of each platform.
What characteristic of Java AWT is described in the given statement?
Evaluate the following statements about Java AWT:
1) Java AWT consists of 15 packages of 370 classes.
2) The java.awt package contains the core AWT classes like component, container, and graphics classes.
3) The java.awt.event package supports event handling.
4) It is an API used to create and manage GUI applications.
Which of the following is true about Java AWT?
It is the top-level container of an AWT program.
Which of the following methods is used to change the visibility of the component or container?
The following are examples of events, except ______________.
What is the correct statement that will set the value of an integer variable ave into the textfield txtAve?
What is the correct statement that will return an integer representing the number of items in the listChosenScore list component?
Using the creation of objects in the given image, identify the correct syntax of placing the label with the text "Second" into the container frame.

When checkboxes are not grouped; then, it allows the users to check or select only one box.
A layout generates an event.
Is the given statement TRUE? If yes, choose TRUE; otherwise, choose an answer that will replace the underlined word and will make the statement correct.
In the given image, what is the frame size set by the programmer?

Given the source code in the image, how is frame created?

In the image, the label l1 is positioned in what x and y coordinates?

What does the following line of code do?
amount = Integer.parseInt(txtAmt.getText());
Evaluate the given statements below about event handling.
1) The listeners process the event and return the response to the event.
2) A source generates an event.
3) Event is received by one or more listeners.
4) The event is sent to the one or more listeners with the source.
Arrange the given statements on how event handling occurred.
Which component in AWT can contain another components like buttons, textfields, labels, etc.?
Analyze the given program code. If the user inputs bpsucict in the text field txtUser, what will be the output of the code?

Analyze the given program code. Which of the following syntax will display the sum of the 3rd and 5th item in the list?
