Java — class (1)

Java provides features that can be used using class. For example, earlier we manipulated texts using string class, we used java.util.Date class to show time. There are many different classes. Programmer can directly create a class of his own too.

Typically, it helps us to efficiently develop a program if we use classes that provide many features and JSP together, rather tan developing 100% with JSP. It is also helpful to maintain the code after it is finished.

Object and Class

Java is an object-oriented language. Object oriented language has variety of features. The most important concept is that objects providing different features are connected to each other to provide necessary features. Here is an example.


  1. Information Form Object
    • sign-up page form
    • asks sign-up object to process this data
  2. sign-up object
    • checks for ID
    • handles sign-up process
    • asks DB to store datas
  3. DataBase object

Form object provides sign-up form, and when sign-up request comes in, rather than processing the registration, it asks sign-up object to handle it. Sign-up object who received the request does various logical processing required for registration. then it asks Database object to store the data. Then Database object adds relevant data into the member table.

Automobile is consist of different parts such as engine, brake, and tire, and they are connected to provide functionality needed. Likewise, different objects are linked together to provide necessary functions. In fact, programming in Java is a process of creating various objects and properly connecting these functions to write a code that provides right functions.

Objects have unique properties and provides functions. For example, objects that contains member information includes informations such as member’s ID, name. Object that has ‘Minjoo Kwon”s information and ‘Jin Namgoong”s information both contain ID and name. In other words, each has different values, but contain same type of informations.

So how can we know which object has what value and offer what features? It is class that is used at this case. Class contains information about the object — what kinds of information and what function it provides.

With the class, we create an object, and that object will have the information defined in class. Object-oriented languages such as C# and C++ including Java use class to define object and create an object.

Leave a comment