how to take array as parameters
Answers
Answered by
2
take a variable initialised as zero.. then take it as parameter..ex.
Class d
.int f= 0;
.. int r() =new int(10);
public void c(int f)
(
sopln("enter any no.");
r(f)=ip;
f±±;
)
psvm
int k;
d obj=new d();
sopln("enter the value ");
k=ip;
obj. c(k);
)
)
note:
it's an sample program form Java io package for ur answer.
ip-Integer. parseInt(in.readLine());
hope it helps
Class d
.int f= 0;
.. int r() =new int(10);
public void c(int f)
(
sopln("enter any no.");
r(f)=ip;
f±±;
)
psvm
int k;
d obj=new d();
sopln("enter the value ");
k=ip;
obj. c(k);
)
)
note:
it's an sample program form Java io package for ur answer.
ip-Integer. parseInt(in.readLine());
hope it helps
Shruti29473:
hi
Similar questions
Science,
7 months ago
CBSE BOARD XII,
7 months ago
Biology,
1 year ago
Science,
1 year ago
Political Science,
1 year ago