[SOLVED] Java program that demonstrates Immutable objects

15.00 $

Programming resource
Digital learning resource
Category:
Practical programming resource
Suitable for guided study and reference
Tutor guidance available when needed

Description

5/5 - (2 votes)

1. a simple Java program that demonstrates Immutable objects and Builder pattern concepts

2. Write a simple Java program that creates a collection of objects of type String. Populate the collection with sample data and use an iterator and a while loop to print the contents.

3. Write a simple Java program that creates a Map with keys of type Integer and values of type String. Populate the map with some sample data. Then do the following.

a. Use a foreach loop to go through each <key, value pair of the map (Hint: use the entrySet method of the Map interface)

b. and on iteration of the for loop, print out the current key and value represented by the iteration.

Resource details

Understand the Task Before You Use the Resource

Review the requirements, identify the programming concepts involved, study the implementation and test your understanding with your own examples and modifications.