课程: Hands-On Introduction: Java

今天就学习课程吧!

今天就开通帐号,24,700 门业界名师课程任您挑!

Create customer

Create customer

- We need to model the customer object of our system to define the structure of an object, we do so with a class. Classes contain fields and methods. The fields are variables that represent the characteristics of the object. And the methods are functions that describe the behaviors the object is capable of. We'll create our class within a package, which is a folder that holds our class files. Under the source main Java directory, we see a package called bank. Bank is all lowercase as it's a Java convention for package names to be lower case. We'll create our Java class within this bank package. Click the plus sign to the right of the bank package, and we'll be prompted to create a class name. We'll name the class Customer with the capital C because in Java it's a convention for classes to begin with a capital letter. Now, let's press enter. Notice the generated file contains a declaration of the package and an empty…

内容