How to create a subclass in Eclipse?

后端 未结 4 918
隐瞒了意图╮
隐瞒了意图╮ 2021-01-17 20:26

During lecture, my professor very quickly created a subclass in Eclipse.

The result has the \"extend\" keyword added to the subclass. I didn\'t see what buttons he

相关标签:
4条回答
  • 2021-01-17 21:14

    When you are viewing the class you want to subclass, open Type Hierarchy (press F4). Right click on the parent-to-be class, and in the menu go to new -> class ( or Ctrl-n , class ).

    0 讨论(0)
  • 2021-01-17 21:14

    Please see the picture where to enter your existing super class

    0 讨论(0)
  • 2021-01-17 21:21

    You can try to bind Keys for New (New Wizard: Class) command (for eg.: Ctrl + Alt + N) by open Window> Preferences > General > Keys.

    And then, on new wizard window, change the Superclass box.

    Hth.

    0 讨论(0)
  • 2021-01-17 21:30

    Right click on project name on Package Explorer + Add New Class + Type package Name, Name (sub-class name), and Super class (or Click on Browse to choose super class).

    0 讨论(0)
提交回复
热议问题