سلام من یه مشکلی دارم موقعی که تو برنامه، مخصوصا برای آرایه ها از x.lenght استفاده میکنم ارور میده و اصلا نمیفهمم باید چیکار کنم
برای مثال من یه برنامه این پایین اوردم:
__________________________________________________ _________
import java.util.Scaer;
public class Ex0
{
public static void main(String[] args)
{
Scaer
in=
new Scaer(System.
in);
int n=in.nextInt();
int[] a=
new int[n];
Methods.
read(a);
Methods.
wright(a);
}
}
public class Methods
{
public static int[]read(int[] x)
{
Scaer in=new Scaer(System.in);
for(int i=0;i<x.lenght;i++)
x[i]=in.nextInt();
retu x;
}
public static void wright(int[] y){
for(int i=0;i<y.length;i++)
System.out.println(y[i]);
}
}
- - , .
برچسب:
نویسنده: محمد رضا جوادیان
تاريخ: چهارشنبه
5 اسفند
1394 ساعت: 21:20