Java දැණුම බෙදාගමු...

Mar 10, 2007
2,113
4
0
37
Sri Lanaka ( Malabe )
setInt(int parameterIndex, int x)

meke parameterIndex kiyanne mokakda.??

parameterIndex kiyanne Parameter ekak with the type int :), obviously setInt is a function (method) so that when ever you call the method you have to pass two parameters parameterIndex and x

setInt(1,10) ( jst a example ) so that u can manipulate parameterIndex variable inside the method as well as the x variable, it has no fix task, the task what parameterIndex does is depends on the cording which your including inside the method,

in this case it will just print the sum

public void getSum(int parameterIndex, int x)
{
int total = 0;
total = parameterIndex + x;
System.out.println("Sum : " + total);
}


getSum(1,9);
output:
Sum : 10
 

shyaamal

Member
Dec 22, 2010
193
14
0
40
Kalagedihena
මොකද කියන්නේ අපි මේ පිටුව දිගටම අරගෙන යමුද ? ජාවා කියන්නේ පට්ටම ලැංවේජ් එකක්. ආ‍සාවෙන් ඉගෙනගන්න පුලුවං