السلام عليكم ورحمه الله وبركاته
انا مبتدئ في الجافا وحاب اتعلم اللغه
سويت برنامج وطلع فيه خطا بسيط ماعرفت اعدله !
البرنامج عباره عن مصفوفه ذات بعدين
اطلب من المستخدم انه يدخل عدد الاعمده والصفوف ومن ثم يقوم البرنامج بطباعه المصفوفه
هذا الكود
import java.util.Scanner;
public class test {
public static void main(String args[]){
Scanner input=new Scanner(System.in);
int row,colomn;
System.out.println("enter number of rows :");
row=input.nextInt();
System.out.println("enter number of columns :");
colomn=input.nextInt();
int array[][]=new int[row][colomn];
for(int i=0 ; i<array.length ; i++){
for(int j=0 ; j<array.length ; j++){
System.out.print("enter row " + i + " colomn " + j + "\n");
array[j]=input.nextInt();
}
}
for(int i=0 ; i<=array.length ; i++){
for(int j=0 ; j<=array.length ; j++)
System.out.print(array[j]);
System.out.print("\n");
}
}
}الخطا يطلع لي هنا
System.out.print(array[j]);
