Want to become a Vibe Coder? Join Vibe Coding Training here
x
C# Corner
Tech
News
Videos
Forums
Jobs
Books
Events
More
Interviews
Live
Learn
Training
Career
Members
Blogs
Challenges
Certification
Contribute
Article
Blog
Video
Ebook
Interview Question
Collapse
Feed
Dashboard
Wallet
Learn
Achievements
Network
Refer
Rewards
SharpGPT
Premium
Contribute
Article
Blog
Video
Ebook
Interview Question
Register
Login
Use Of This Operator Program in Java
WhatsApp
Alagunila Meganathan
Aug 03
2016
470
0
0
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
Up Next
Use Of This Operator Program in Java