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
Java - Method With Parameter
WhatsApp
Senthilvelan Sambamoorthy
Aug 20
2016
636
0
0
fun1.rar
class
fun1
{
int
a, b;
void
calc(
int
x,
int
y)
{
a = x;
b = y;
}
void
add()
{
System.out.println(
"\nAddition :"
+(a+b));
}
void
sub()
{
System.out.println(
"\nSubtraction :"
+(a-b));
}
void
mul()
{
System.out.println(
"\nMultiplication :"
+(a*b));
}
void
div()
{
System.out.println(
"\nDivision :"
+(a/b));
}
void
rem()
{
System.out.println(
"\nModules :"
+(a%b));
}
public
static
void
main(String arg[])
{
fun1 x;
x =
new
fun1();
x.calc(
10
,
3
);
x.add();
x.sub();
x.mul();
x.div();
x.rem();
}
}
Java
Method With Parameter
Up Next
Java - Method With Parameter