Java Reference
In-Depth Information
DAY 5:
Creating Classes and
Methods
If you're coming to Java from another programming language, you might
be struggling with the meaning of the term class . It seems synonymous to
the term program , but you might be uncertain of the relationship between
the two.
In Java, a program is made up of a main class and any other classes
needed to support the main class. These support classes include any of
those you might need in the Java class library, such as String , Math , and
the like.
Today, the meaning of class is clarified as you create classes and meth-
ods, which define the behavior of an object or class. You undertake each
of the following:
The definition of the parts of a class
n
The creation and use of instance variables
n
The creation and use of methods
n
The use of the main() method in Java applications
n
The creation of overloaded methods that share the same name
but have different signatures and definitions
n
The creation of constructor methods that are called when an
object is created
n
 
Search WWH ::




Custom Search