Question: Sernng tra Test 3 Your Name, Cs 170-01 Programming c) new Arraytist ) d) ArrayList ) 32) Suppose Arraytet x contains two strings (Be13ing, singapore).

 Sernng tra Test 3 Your Name, Cs 170-01 Programming c) new

Sernng tra Test 3 Your Name, Cs 170-01 Programming c) new Arraytist ) d) ArrayList ) 32) Suppose Arraytet x contains two strings (Be13ing, singapore). Which of the following methods wil the list to become [Beijing, Chicago, singapore ]? a) x.add ("Chicago) b) x.add(, "Chicago. ) c)x.add(1, Chicago. ) d) x. add (2, Chicago* 33) What modifier shoul cannot access it? a class in the sanse package can access it but a class in a different package ld you use on a class so that a) publie b)private c) protected d) Use the default modifier 34) Which of the following classes cannot be extended? a) class { } b) clasa A private A): c) final class ( ) d) class A protected a0: 35) Polymorphism means a) that data fields should be declared private b) that a class can extend another class c) that a variable of supertype can refer to a subtype object d) that a class can contain another class. 36) Encapsulation means a) that data fields should be declared private. b) that a class can extend another class. c) that a variable of supertype can refer to a subtype object. d) that a class can contain another class. 37) Composition mcans a) that data fields should be declared private. b) that a class extends another class o) that a variable of supertype refers to a subtype object. d) that a class contains a data field that references another object. II. (27 points) Short-Answer Questions 1. In the space provided, briefly address the following questions: (3 points) Define polymorphism in Java? (3 points) What is an explicit casting in Java? (3 points) Give a code example of an explicit cassing in Java? 10

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!