Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
A

angrybobcat

@angrybobcat
About
Posts
3
Topics
0
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Something is wrong with the print command.
    A angrybobcat

    Please get your code to a compilable form - everyone trying to read this has to guess what you actually mean several times to get that right. Regards, ab

    Java graphics debugging career

  • Using the Observer and Observable Class
    A angrybobcat

    Where "Observer" is actually "Observable" as you got it right in your first post, since "Observer" and "Subscriber" are basically the same thing.

    Java java data-structures testing beta-testing performance

  • problem with inheritance
    A angrybobcat

    To explain that, take a look at what is executed and why. First of all, you create a new Derived-Instance as an instance of Base. Take a look at how you call the static method foo(): You dont access it in a static way (to use exact the phrase the compiler will warn you with) - which would be Base.foo() or Derived.foo() - but you call it on an instance. As mentioned, bObj is an instance of Base (because you declared it as that) and thus the static Method Base.foo() is called, which prints the "In Base.foo()"-Part of your output. If you declared it as an instance of Derived, the static method Derived.foo() would have been called there. To explain the part "In Derived.bar()" take a look at what is called next: In Base.bar() you call bObj.bar(); bObj was instantiated with new Derived(), so the method bar() on that object is overriden with the implementation in Derived, which prints then "In Derived.bar()". I hope that explains inheritance a bit better. ab

    Java oop help question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups