Go Back   Site Owners Forums - Webmaster Forums > Web Programming > Programming General > Java

Notices


Reply
 
Thread Tools Rate Thread Display Modes
Old 08-19-2016, 10:33 PM   #1
addisoncave
Registered User
 
Join Date: Jun 2016
Posts: 169
Object Oriented Programming is a more efficient approach of programming, that focus on data rather than function.Object is quite similar to a real time entity that have some attributes and behavior, where Class is the blueprint of an object. we create object to work with everything. First we design a prototype of that object object with class.
The simplified syntax of code in Java is:
Quote:
class Rectangle{ //creating class
int length; //variable members (attribute)
int width;

void insert(int l,int w){ //member methods (behavior)
length=l;
width=w;
}

void calculateArea(){System.out.println(length*width);}

public static void main(String args[]){
Rectangle r1=new Rectangle(); //creating object
Rectangle r2=new Rectangle();

r1.insert(11,5);
r2.insert(3,15);

r1.calculateArea();
r2.calculateArea();
}
}
__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
addisoncave is offline   Reply With Quote

Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
What is the meaning of object oriented in programming ? sana8745 Programming General 5 03-24-2015 10:15 PM
[NEW]: XenLayer Hosting Affiliate Program - 100% commission per signup RussF Hosting Discussion 2 09-30-2014 01:14 PM
I have a new affilaite program that pays to give away Stock Photography eooc.box The Market 2 03-02-2013 02:20 AM
[NEW]: XenLayer Hosting Affiliate Program - 100% commission per signup RussF Post your ad here 1 03-01-2013 04:44 AM


All times are GMT -7. The time now is 06:26 AM.


Powered by vBulletin Copyright © 2020 vBulletin Solutions, Inc.