public class Test045
{
int Method1(int i) { return 1; } //1
//void Method2(int i) { return i + 1; } //2
int Method3(int i) { return i + 1; } //3
void Method4(int i) { return; } //4
public static void main(String args[]){
Test045 demo = new Test045();
System.out.println(demo.Method1(1));
//System.out.println(demo.Method2(2));
System.out.println(demo.Method3(3));
// WHy does it give error,Can not convert int to char[].........?
System.out.println(demo.Method4(2));
}
}
Swati Kale
SCJP
SCWCD
public class Test045
{
void Method4(int i) { return; } //4
public static void main(String args[]){
Test045 demo = new Test045();
System.out.println(demo.Method4(2));
// When I call a method with integer literal,it gives error as ,Can not convert void to char[].........?
}
}
Swati Kale
SCJP
SCWCD
Originally posted by swati bannore:
Hi,
Let me make it very simple and clear.
Hope it will be clear now,and u cld help me.
Thanx
Swati Kale
SCJP
SCWCD
Swati Kale
SCJP
SCWCD
Originally posted by swati bannore:
Guoqiao Sun<br />SCJP2 SCWCD2<br />Creator of <a href="http://www.jiris.com/" target="_blank" rel="nofollow">www.jiris.com</a>, Java resource, mock exam, forum
Guoqiao Sun<br />SCJP2 SCWCD2<br />Creator of <a href="http://www.jiris.com/" target="_blank" rel="nofollow">www.jiris.com</a>, Java resource, mock exam, forum
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime. |