Bobinas P4G
  • Login
  • Public

    • Public
    • Groups
    • Popular
    • People

Conversation

Notices

  1. ᛞᚩᚳᛁᛞᚩᚳᛁ (dokidoki@gs.smuglo.li)'s status on Sunday, 15-Jan-2017 20:38:13 UTC ᛞᚩᚳᛁᛞᚩᚳᛁ ᛞᚩᚳᛁᛞᚩᚳᛁ
    How to: Shoot yourself in the foot using java.

    You locate the Gun class, but discover that the Bullet class is abstract, so you extend it and write the missing part of the implementation. Then you implement the ShootAble interface for your foot, and recompile the Foot class. The interface lets the bullet call the doDamage method on the Foot , so the Foot can damage itself in the most effective way. Now you run the program, and call the doShoot method on the instance of the Gun class. First the Gun creates an instance of Bullet , which calls the doFire method on the Gun . The Gun calls the hit(Bullet) method on the Foot , and the instance of Bullet is passed to the Foot . But this causes an IllegalHitByBullet exception to be thrown, and you die.
    In conversation Sunday, 15-Jan-2017 20:38:13 UTC from gs.smuglo.li permalink
    • 御園はくい repeated this.

Feeds

  • Activity Streams
  • RSS 2.0
  • Atom
  • Help
  • About
  • FAQ
  • Privacy
  • Source
  • Version
  • Contact

Bobinas P4G is a social network. It runs on GNU social, version 2.0.1-beta0, available under the GNU Affero General Public License.

Creative Commons Attribution 3.0 All Bobinas P4G content and data are available under the Creative Commons Attribution 3.0 license.