Skip to content

Smthng0/Week-2

Repository files navigation

Week-2

2nd week of learning

Exercise 8.a, page 230:

i need to figure out which class implements and extends what, using dash for "implements" and solid line for "extends"

i'll just write in words, since this is not graphical

  1. Bar implements Foo
  2. Vout implements Vinn and is abstract
  3. Fluffie extends Muffie, Muffie implemets Whuffie
  4. Goop extends Boop, Boop extends Zoop
  5. Alpha extends Gamma and implements Beta, Gamma extends Delta and implemets Epsilon

Exercise 8.b, page 231:

i have some diagrams and have to type the inheritance/interface from the picture

  1. public class Click{}
    public class Clack extends Click{}
  2. public abstract class Top{}
    public class Tip extends Top{}
  3. public abstract class Fee{}
    public abstract class Fi extends Fee{}
  4. interface Foo{}
    public class Bar implement Foo{}
    public class Baz extends Br{}
  5. interface Zeta{}
    interface Beta{}
    public class Alpha implements Zeta{}
    public class Delta extends Alpha implements Beta{}

Exercise 9.a, page 266:

pick which line add one object for the Garbage Collector

lines 2, 4, 6, 8

Exercise 9.b, page 267:

several objects added, find the one with the most reference variables and lost how many there are...

The object with the most reference variables is: "Honey (11)" and there are x reference variables...
i didn't catch the one that creates the honey class from the raccoon class which calls the kit class, there are 12 in total...

Exercise 10.a, page 310:

code, will it compile and what output?

Output 2 will be out, statics run first and then the constructors (when the class is called upon)
I missed that the StaticSuper is missing curves...

Exercise 10.b, page 311:

true or false?

  1. False
  2. False
  3. True
  4. False
  5. True
  6. False
  7. True
  8. True
  9. False
  10. False
  11. False
  12. True
  13. False
  14. False

Sharpen your pencil 16.b, page 555:

fill-in-the-blanks

  1. Comparable
  2. compareTo()
  3. Yes
  4. Yes
  5. Yes
  6. No
  7. No
  8. Comparator
  9. compare()

Exercise 16.a, page 576:

compiles or doesn't compile?

statements 1, 2, 4, 5, 9 would compile!

About

2nd week of learning

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages