![]() |
< Day Day Up > |
![]() |
Recipe 3.4 Creating a Java Class3.4.1 ProblemYou want to create a new Java class in which to enter code. 3.4.2 SolutionSelect a project and then select File 3.4.3 DiscussionWhen you select File Figure 3-7. Creating a Java class![]() Note the options in this dialog. You can specify the name of the package this class should be in (if the package doesn't exist, it'll be created). You can set the access modifier for the class, as well as the class's superclass, which enables you to implement inheritance. You can also specify what interfaces you want the class to implement, as well as a set of method stubs to create: main, a constructor, and inherited abstract methods.
3.4.3.1 Creating an anonymous inner classIn Eclipse 3.0, code assist (also called content assist) can
help when you want to create an
anonymous inner class. Place the cursor after the opening brace of a
class instance creation and press Ctrl-Space (or select
Edit |
![]() |
< Day Day Up > |
![]() |