Levels Tought:
Elementary,Middle School,High School,College,University,PHD
Teaching Since: | Apr 2017 |
Last Sign in: | 10 Weeks Ago |
Questions Answered: | 4870 |
Tutorials Posted: | 4863 |
MBA IT, Mater in Science and Technology
Devry
Jul-1996 - Jul-2000
Professor
Devry University
Mar-2010 - Oct-2016
Hi! I really need help with the attached assignment.. Thanks in advance!!!!
Â
1. (10 pts) What are the diagrams defined in the UML Standard.Give a one or two sentencedescription of each one.2. (10 pts) Given the following code, how should the toString methods in the classes H2ClassAand H2ClassB be written to give the indicated output and take advantage of the natural toStringmethod in H2ClassB?1  import java.util.ArrayList;2 3  public class H2ClassA {4    ArrayList <H2ClassB> list = new ArrayList <H2ClassB>();5 6    public static void main (String args []) {7      H2ClassA y = new H2ClassA ();8      int [] v = {4, 3, 7, 5, 99, 3};9      for (int m: v) 10       y.list.add (new H2ClassB (m));11     System.out.println (y);12   } // end main13 14 } // end class H2ClassA15 16 class H2ClassB {17   int x;18   H2ClassB (int a) { x = a;}19 } // end H2ClassBOUTPUT:4 3 7 5 99 33. (10 pts) How can the following code be corrected?Give at least two good answers.1 public class H2ClassC {2   H2ClassC (int a) {}3 } // end class H2ClassC4 5 class H2ClassD extends H2ClassC{6 } // end class H2ClassD
Attachments:-----------