100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached
logo-home
(CS-D286) ITSW 3172 Java Fundamentals - Latest FA Review Q & S 2024 $17.49   Add to cart

Class notes

(CS-D286) ITSW 3172 Java Fundamentals - Latest FA Review Q & S 2024

 1 view  0 purchase

(CS-D286) ITSW 3172 Java Fundamentals - La(CS-D286) ITSW 3172 Java Fundamentals - Latest FA Review Q & S 2(CS-D286) ITSW 3172 Java Fundamentals - Latest FA Review Q & S 20(CS-D286) ITSW 3172 Java Fundamentals - Latest FA Review Q & S test FA Review Q & S 2024

Preview 4 out of 42  pages

  • November 21, 2024
  • 42
  • 2024/2025
  • Class notes
  • Unknown
  • All classes
All documents for this subject (40)
avatar-seller
ClemAcademia
CS – D286 ITSW 3172




Java Fundamentals




LATEST FINAL ASSESSMENT
REVIEW
Q&S



©2024/2025

, 1. Multiple Choice: What does the expression `Map<String,
Integer> map = new HashMap<>();` instantiate?
a) A HashMap with keys of type String and values of type
Integer
b) A HashMap with keys and values of type String
c) A HashMap with keys and values of type Integer
d) A Map with keys of type String and values of type Integer
ANS: a) A HashMap with keys of type String and values of type
Integer
Rationale: The diamond operator `<>` infers the type
parameters from the context, in this case, String for keys and
Integer for values.


2. Fill-in-the-Blank: The _______ method must be implemented
by a class that implements the interface Comparable.
ANS: compareTo
Rationale: The compareTo method is defined in the Comparable
interface and is used for comparing "this" object with the
specified object for order.



©2024/2025

,3. True/False: In Java, the '==' operator can be used to compare
two strings for equality.
ANS: False
Rationale: The '==' operator compares references, not values,
and thus, it is not reliable for string content comparison. The
`equals()` method should be used instead.


4. Multiple Response: Which of the following are valid Java
identifiers? (Choose all that apply)
a) _identifier
b) 2ndName
c) $alary
d) void
e) Java2Share
ANSs: a) _identifier, c) $alary, e) Java2Share
Rationale: Java identifiers can start with a letter, currency
character, or connecting character like an underscore. '2ndName'
starts with a digit, and 'void' is a reserved keyword.


5. Multiple Choice: Which of these access specifiers can be used
for an interface?
a) private
b) protected
©2024/2025

, c) public
d) All of the above
ANS: c) public
Rationale: Interfaces can only be declared with public or default
(package-private) access, but not with private or protected access.


6. True/False: The hashCode() method of an object is guaranteed
to be unique for each instance.
ANS: False
Rationale: The hashCode() method is not required to produce a
unique integer for each distinct object. Two different objects can
have the same hash code.


7. Fill-in-the-Blank: A class that is declared with the abstract
keyword is known as an _______.
ANS: abstract class
Rationale: An abstract class cannot be instantiated on its own
and can include abstract methods that must be implemented by
subclasses.


8. Multiple Choice: Which collection class allows you to grow or
shrink its size and provides indexed access to its elements?
a) Array

©2024/2025

The benefits of buying summaries with Stuvia:

Guaranteed quality through customer reviews

Guaranteed quality through customer reviews

Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.

Quick and easy check-out

Quick and easy check-out

You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.

Focus on what matters

Focus on what matters

Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!

Frequently asked questions

What do I get when I buy this document?

You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.

Satisfaction guarantee: how does it work?

Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.

Who am I buying these notes from?

Stuvia is a marketplace, so you are not buying this document from us, but from seller ClemAcademia. Stuvia facilitates payment to the seller.

Will I be stuck with a subscription?

No, you only buy these notes for $17.49. You're not tied to anything after your purchase.

Can Stuvia be trusted?

4.6 stars on Google & Trustpilot (+1000 reviews)

67474 documents were sold in the last 30 days

Founded in 2010, the go-to place to buy study notes for 14 years now

Start selling
$17.49
  • (0)
  Add to cart