Tuesday, November 10, 2015

Class In Java

QUE- What is Class in Java Programming

CLASS: “A class is a way of binding the data and associated methods in a single unit
Any JAVA program if we want to develop then that should be developed with respective
class only i.e., without class
In object oriented programming’s
member methods and non-member methods
• A member method is one which is comes under the scope of the
only member methods
• Non-member methods
does not allow non-member methods
Class diagram for defining a class
Syntax for defining a CLASS:
Class <clsname>
{
Variable declaration;
Methods definition;
};
Here, class is a keyword
Clsname represents a JAVA valid variable name and it is treated as name of the
are used for creating objects.
Class contains two parts namely
declaration represents what type of
definition represents the type of
operation.
By making use of the variables
must be defined with in the class
Example: Define a class called a student..?
Answer:
Class student
{
Int stno;
String stname;
J2SE (Core JAVA) Notes
there is no JAVA program.
programming’s, generally we write two types of
methods.
class
methods.
are those which are not comes under the scope of the
at all.
class:
eclaration;
efinition;
which is used for developing or creating user defined datatypes
variable declaration and method definitions
data members which we use as a part of the
methods which we used as the path of the
variables, which are declared inside the class? Every operation in
only i.e., outside definition is not possible

unit”.
, methods. They are
class. In JAVA we use

class. JAVA



Syntax for defining a CLASS:

Class <clsname>
{
Variable declaration;
Methods definition;
};
Here, class is a keyword
Clsname represents a JAVA valid variable name and it is treated as name of the
are used for creating objects.

No comments:

Post a Comment