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
Java - Method With Parameter
Senthilvelan Sambamoorthy
Aug 20
2016
Code
558
0
0
facebook
twitter
linkedIn
Reddit
WhatsApp
Email
Bookmark
expand
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