Not able to get all the values in Array of object
public class A{
public static void firstMethod(){
B b = new B();
......
b.setting
sampleMethod(c);
..
}
public static void sampleMetod(C[] c)
long id;
long code;
for(int i=0;i<10;i++){
id = value.getId();
code = value.getCode();
}
...
}
public class B{
....
long id;
long code;
C[] c = new C[];
public C[] setting(){
....
for(int i=0;i<10;i++)
// here i'm getting 10 values form Table
id = 10000
code = 11111
c.setId(id);
c.setCode(code);
....
return c
}
}
public calss C {
long id;
long code;
....
public static void setId(long id){}
public static void setCode(long code){}
public static long getId(){
return Id;
}
public static long getCode(){
return Code;
}
}
I try to invoke setting() method in classB from class A. it will return array of object class C.
In Class A, when i try to get the values whatever set it in Class C using array of object class C, i'm not getting all the values. i got only the last value of array.
can u pls help me how to get all the values?
Thanks for ur help in advance.
public class A{
public static void firstMethod(){
B b = new B();
......
b.setting
sampleMethod(c);
..
}
public static void sampleMetod(C[] c)
long id;
long code;
for(int i=0;i<10;i++){
id = value.getId();
code = value.getCode();
}
...
}
public class B{
....
long id;
long code;
C[] c = new C[];
public C[] setting(){
....
for(int i=0;i<10;i++)
// here i'm getting 10 values form Table
id = 10000
code = 11111
c.setId(id);
c.setCode(code);
....
return c
}
}
public calss C {
long id;
long code;
....
public static void setId(long id){}
public static void setCode(long code){}
public static long getId(){
return Id;
}
public static long getCode(){
return Code;
}
}
I try to invoke setting() method in classB from class A. it will return array of object class C.
In Class A, when i try to get the values whatever set it in Class C using array of object class C, i'm not getting all the values. i got only the last value of array.
can u pls help me how to get all the values?
Thanks for ur help in advance.
there was some typo mistake in my previous post
public class A{
public static void firstMethod(){
B b = new B();
......
b.setting
sampleMethod(c);
..
}
public static void sampleMetod(C[] c)
long id;
long code;
for(int i=0;i<10;i++){
id = c.getId();
code = c.getCode();
}
...
}
public class B{
....
long id;
long code;
C[] c = new C[];
public C[] setting(){
....
for(int i=0;i<10;i++)
// here i'm getting 10 values form Table
id = 10000
code = 11111
c.setId(id);
c.setCode(code);
....
return c
}
}
public calss C {
long id;
long code;
....
public static void setId(long id){
c.id=id;
}
public static void setCode(long code){
c.code=code;
}
public static long getId(){
return Id;
}
public static long getCode(){
return Code;
}
}
I try to invoke setting() method in classB from class A. it will return array of object class C.
In Class A, when i try to get the values whatever set it in Class C using array of object class C, i'm not getting all the values. i got only the last value of array.
can u pls help me how to get all the values?
Thanks for ur help in advance.