dokumen.tips_java-development-companies-in-bangalore
dokumen.tips_java-development-companies-in-bangalore
import java.awt.*;
import java.util.*;
public class SomethingOrOther {
// object definitions go here
. . .
}
This must be in a file named SomethingOrOther.java !
What is a class?
Early languages had only arrays
all elements had to be of the same type
Then languages introduced structures
(called records, or structs)
allowed different data types to be grouped
Then Abstract Data Types (ADTs) became
popular
grouped operations along with the data
So, what is a class?
A class consists of
a collection of fields, or variables, very much
like the named fields of a struct
all the operations (called methods) that can be
performed on those fields
can be instantiated
A class describes objects and operations
defined on those objects
Name conventions
Java is case-sensitive; maxval, maxVal, and
MaxVal are three different names
Class names begin with a capital letter
All other names begin with a lowercase letter
Subsequent words are capitalized: theBigOne
Underscores are not used in names
These are very strong conventions!
The class hierarchy
Classes are arranged in a hierarchy
The root, or topmost, class is Object
Every class but Object has at least one
superclass
A class may have subclasses
Each class inherits all the fields and methods
of its (possibly numerous) superclasses
Presented By:
5ine Web solution pvt.
Ltd
http://www.5ine.in
5ine Web Solutions Pvt. Ltd.
Bengaluru, Karnataka , India 560078
Mobile +91-88844-11366
Landline +91-80-26663298
Email : [email protected]
Thank you.