TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
C# Corner
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Use Of This Operator Program in Java
Alagunila Meganathan
Aug 03
2016
Code
416
0
0
facebook
twitter
linkedIn
Reddit
WhatsApp
Email
Bookmark
expand
UseOfThisOperator.ra
public
class
UseOfThisOperator{
public
static
void
main(String[] args){
Rectangle rectangle=
new
Rectangle();
rectangle.show(
5
,
6
);
int
area = rectangle.calculate();
System.out.println(
"The area of a Rectangle is: "
+ area);
}
}
class
Rectangle{
int
length, breadth;
void
show(
int
length,
int
breadth){
this
.length = length;
this
.breadth = breadth;
}
int
calculate(){
return
(length * breadth);
}
}
Java