Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Exam (elaborations)

PRO192 Chapter 1-3 Practise Question Reviews

Rating
-
Sold
-
Pages
16
Grade
A+
Uploaded on
09-08-2024
Written in
2024/2025

PRO192 Chapter 1-3 Practise Question Reviews Chapter 1 Which of the following are valid declarations? Assume .* is imported. A. VectorMap v; B. SetString s; C.

Institution
Course

Content preview

PRO192 Chapter 1-3 Practise Question Reviews


Chapter 1
Which of the following are valid declarations? Assume
java.util.*
is imported.
A.
Vector<Map> v;
B.
Set<String> s;
C.
Map<String> m;
D.
Map<String, String> m;

(3 answer) ** Answ** a,b,d

You can determine all the keys in a Map in which of the following ways?
A.
By getting a Set object from the Map and iterating through it.
B.
By iterating through the Iterator of the Map.
C.
By enumerating through the Enumeration of the Map.
D.
By getting a List from the Map and enumerating through the List.
E.
You cannot determine the keys in a Map. ** Answ** a

What keyword is used to prevent an object from being serialized?
A.
private
B.
volatile
C.
protected
D.
transient
E.
None of the above ** Answ** d

,An abstract class can contain methods with declared bodies.
A.
True
B.
False ** Answ** a

Select the order of access modifiers from least restrictive to most restrictive.
A.
public
,
private
,
protected
, default
B.
default,
protected
,
private
,
public
C.
public
, default,
protected
,
private
D.
default,
public
,
protected
,
private
E.
public
,
protected
, default,
private ** Answ** e

Which access modifier allows you to access method calls in libraries not created in
Java?
A.
public
B. static

, C. native
D. transient
E. volatile ** Answ** c

Which of the following statements are true? (Select all that apply.)
A. A final object's data cannot be changed.
B. A final class can be subclassed.
C. A final method cannot be overloaded.
D. A final object cannot be reassigned a new address in memory.
E. None of the above. ** Answ** d

The keyword extends refers to what type of relationship?
A. "is a"
B. "has a"
C. "was a"
D. "will be a"
E. None of the above ** Answ** a

Which of the following keywords is used to invoke a method in the parent class?
A. this
B. super
C. final
D. static ** Answ** b

Given the following code, what will be the outcome?
public class Funcs extends java.lang.Math {
public int add(int x, int y) {
return x + y;
}
public int sub(int x, int y) {
return x - y;
}
public static void main(String [] a) {
Funcs f = new Funcs();
System.out.println("" + f.add(1, 2));
}
}
A. The code compiles but does not output anything.
B. "3" is printed out to the console.
C. The code does not compile.
D. None of the above. ** Answ** c

Given the following code, what is the expected outcome?
public class Test {
public static void main(String [] a) {
int [] b = [1,2,3,4,5,6,7,8,9,0];

Written for

Course

Document information

Uploaded on
August 9, 2024
Number of pages
16
Written in
2024/2025
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

$11.19
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF


Also available in package deal

Get to know the seller

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
smartchoices Chamberlain College Of Nursing
Follow You need to be logged in order to follow users or courses
Sold
36
Member since
5 year
Number of followers
5
Documents
4499
Last sold
2 weeks ago

4.8

9 reviews

5
7
4
2
3
0
2
0
1
0

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions