Home of real teaching & learning
  • Full support for teachers
  • Focus on critical thinking
  • Engaging classroom activities
  • Integrated student eBook
  • Assessed tasks / qBank
  • Practice exam questions

The InThinking Guarantee: Our sites are written by expert practitioners and not by AI

See our AI policy

Disclaimer: InThinking subject sites are neither endorsed by nor connected with the International Baccalaureate Organisation.

Don't miss out, find out!

B 4.1.5 Worksheet 2 Java

Name: ________ Given the following two HashSet objects: Set<Integer> set1 = new HashSet<>(Arrays.asList(10, 20, 30, 40, 50));Set<Integer> set2 = new HashSet<>(Arrays.asList(40, 50, 60, 70)); 1. Union 2. Intersection 3. Difference Write the Java code to create a new HashSet called differenceResult containing the elements in set1 but not set2.____________________________________________________________

Help