Hi,
I am a new bee to java. I like this programming language very much because it uses the object oriented features. I know java classes, but an good explanation can help me know classes better. Thanks
Hi,
I am a new bee to java. I like this programming language very much because it uses the object oriented features. I know java classes, but an good explanation can help me know classes better. Thanks
Java is a object-oriented programming. In java programming language a class acts as a construct and it is used as blueprint to create objects. The blueprint is the state and behavior and all objects of the class share it. An object is called the instance of the class.
Last edited by Praetor; 03-11-2009 at 09:43 AM.
Classes are the fundamental of java programming language. An class employee can be defined as:
class Employee {
int age;
double salary;
}
Here "Employee" is a class. By convention the initial of a class is capital.
Classes are used in java so that the code can be robust and reused. Classes simplify the work between interrelated data. Here is another example of class in java
public class Film {
String called;
int minutes;
public Film (String title, int length) {
called = title;
minutes = length;
}
public int getminutes() {
return minutes;
}
public String getcalled() {
return called;
}
public void setminutes(int length) {
minutes = length;
}
}
Bookmarks