Question: CSE 205 Homework // Need help figuring out the questions with the symbol * next to them starting at 3.2*, then 3.4* and so on.

CSE 205 Homework // Need help figuring out the questions with the symbol * next to them starting at 3.2*, then 3.4* and so on. Thanks again.

CSE 205 Homework // Need help figuring out the questions with the

symbol * next to them starting at 3.2*, then 3.4* and soon. Thanks again. ArrayLists 3.1 Write a method named ArrayList listInit ()that creates an ArrayList object named list and fills list with thesenumbers (using one or a pair of for or while loops) 01 2 3 4 5 6 78 9 10 0 1 2

ArrayLists 3.1 Write a method named ArrayList listInit () that creates an ArrayList object named list and fills list with these numbers (using one or a pair of for or while loops) 0 1 2 3 4 5 6 78 9 10 0 1 2 3 4 5 6 7 8 9 10 3.2 Consider the ArrayList object named list containing these Integers: list 1, 2, 3, 4, 5, 4, 3, 2, 1, o h What are the contents of list after this loop completes? for (int i 1; i object named list are nega- tive. Print the count after the loop terminates. 3.4 Write a void method void listInsertName(ArrayList mRoster: Roster Student mName: String UndergradStudent GradStudent 8.2 Suppose the class Sub extends Sanduich. Which of the following statements (a)-(d) are legal? Sandwich x w Sandich); Sub y ne SubO (a) xy (b) y x; (c) Sub y e SanduichO (d) Sandwich x- SubO 8.3 True or False? A subclass declaration will generally contain declarations for instance variables that are specific to ob- jects of that subclass, i.e., those instance variables represent attributes that are not part of superclass objects. Whether you choose True or False, explain your answer. i... why you believe the statement is True or False. 8.4 True or False? A superclass declaration will generally contain declarations for instance variables that are specific to objects of that superclass, .e, te instance variables represent attributes that are not part of subclass objects. Whether you choose True or False. explain your answer. i... why you believe the statement is True or False. 8.5 Consider classes Cl, C2, and C3. Answer the following questions. Regarding a class's instance variables, by "directly accessible", we mean that if we are executing, say, c2Method1), is it syntactically legal to write a statement that accesses, say, instance variable x3 of class Cl, eg., in c2Methodl), is -x3; a legal statement? Similarly, regarding a class's instance methods, by "callable", we mean that if we are executing, say, c3Method20, is it syntactically legal to write a statement c1Method2): to call that method which is declared in C1? class C1 d20% class C2 extends Ci class C3 extends C2 public int x1; public int yl; protected int y2; private int y3; public void c2Method1 public int zi; protected int z2; private int z3; public void c3Method1 protected void c3Method2o private void c3Method30 protected int x2; private int x3; public void c1Method1o protected void c1Method20 protected void c2Method20 O private void c1Method3) private void c2Method30 t 1. Which instance variables xl, x2, x3 declared in Cl are directly accessible in lMethod10? 2. Same variables, in clMethod20? 3. Same variables, in clMethod3)? 4. Which instance variables xl, x2, x3 declared in Cl are directly accessible in c2Methodl0? . Same variables, in c2Method20? 6. Same variables, in c2Method3)? 7. Which instance variables xl, x2, x3 declared in Cl are directly accessible in e3Method10? 8. Same variables, in c3Method20? 9. Same variables, in c3Method3)? 10, which instance variables yl, y2, y3 declared in C2 are directly accessible in cl Method 10? 11. Incl Method2()? 12. In clMethod3)? 13. Which instance variables z1, 22, 23 declared in C3 are directly accessible in clMethod1)? 14. Same variables, in clMethod2)? 15. Same variables, in cl Method30)? 16. Which instance methods clMethodl0, clMethod20, clMethod30 are callable from c2Method10? 17. Which Cl methods are callable from c2Method20? 18. Which Cl methods are callable from c2Method30? 19. Which instance methods clMethod clMethod20, clMethod30 are callable from c3Method10? 20. Which Cl methods are callable from c3Method20? 21. Which Cl methods are callable from c3Method30? 22. Which instance methods c2MethodlO. c2Method20, c2Method30 are callable from clMethod10? 23. Which C2 methods are callable from clMethod20? 24. Which C2 methods are callable from clMethod30? 25. A C1 object is created as a block of memory. Within that block of memory, how many instance variables exist? 26. A C2 object is created as a block of memory. Within that block of memory, how many instance variables exist? 27. A C3 object is created as a block of memory. Within that block of memory, how many instance variables exist? 8.6 Explain what an overloaded method is and give an example by writing some Java code. 8.7 Explain what an overridden method is and give an example by writing some Java code. 8.8 Explain what accidental overloading is and the preferred Java method for preventing it. 8.9 If an overridden method in a subclass needs to call the overridden superclass method, how is this accomplished? 8.10 True or False? It is legal to write a method in a class which overloads another method declared in the same class. Explain your answer 8.11 True or False? It is legal to write a method in a class which overrides another method declared in the same class. Explain your answer 8.12 True or False? It is legal in a subclass to write a method which overloads a method declared in the super class. Explain your answer 8.13 True or False? It is legal to write a method in a subclass which overrides a method declared i the super-class. Explain your

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!