Introduction About Class Object Methods

Java language is object oriented programming language. We can also call OOP. Class Object Methods will help to give MVC structure to our programs.

Let’s understand basic concepts of class.

  1. class is keyword in java language
  2. class is collection of methods and variable
  3. one class can share its properties with other class using relation
  4. We can customize our classes in different packages and manage from one location.

Let’s understand basic concepts of object

  1. Object can store memory of variables and manage variables and methods of class.
  2. Object can assign to reference and create clone object.

 

Let’s understand concepts of methods

  1. Methods define in class.
  2. Using of object we can handle methods.

 

Let’s see simple structure of Class Object Methods in Example.

 

class A                         // Class

{

            void method()  // method in class

            {

                        // Do your programs…

}

}

class clEx

{

            public static void main(String args[])

{

            A obj = new A();           // Create obj as object

            obj.method();               // calling

}

}

 

This is basic structure of class programs.

 
class A:Simple Class
void method():Class’s Method
class clEx:Main Class
A obj = new A();:Process, to create an object
obj.method();:Call to method() in class A

 


[sbscrbr_form]

If you have query about this blog, you can directly post comment or subscribe on website.


 

963total visits,5visits today


mayank

Hello, I am Maddy a Java blogger, trainer and developer

Related articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Your comments (*)

Name (*)

Your full name please.

Email address (*)

Used for gravatar.

Website

Link back if you want.

Enter Captcha Here :*

Reload Image