Lab 1 En

1. Instantiate an object that contains String objects and print its content. Each existing String is stored only once.

  String s1 = new String(“s”);
  String s2 = new String(“s”);
  System.out.println(myObject) -> prints s

2. Instantiate an object that contains unique String objects and each kept object (its type is String) has a corresponding integer value that can be changed.

3. Given the next class,

  class Person {
	private String firstName, lastName;
	// … constructor, toString, 
  }

instantiate an object that contains instances of Person and print its content. Each existing Person is stored only once.

4. Instantiate an Object that contains unique instances of Person and each kept object (type: Person) has a corresponding integer value that can be changed.

5. Read the content of File1.txt and File2.txt.

6. Create/download a JSON file and read its content in Java.

Some instructions here

7. Declare a dictionary in Python and print its content. You can execute the code online Python Online.