There are some error in lion no 15 .can anyone help me to fix this???
- import java.util.Scanner;
- public class intArray
- {
- public static void main (String [] args)
- {
- final int size =10;
- int [] array = new int [size];
- Scanner input = new Scanner (System.in);
- for (int a=0 ; a<size; a++) //data entering
- {
- System.out.println ("Enter the " + a+1 + " Element :");
- int array [a] = input.nextInt();//somthing is wrong in this line
- }
- printArray (array);
- }
- void printArray (int [] array1) // Dispaly the array
- {
- for (int a=0;a<array1.length;a++)
- {
- System.out.print (array1[a] + " ");
- }
- }
- }
Malaka_1 0 Newbie Poster
masijade 1,351 Industrious Poster Team Colleague Featured Poster
stultuske 1,116 Posting Maven Featured Poster
Malaka_1 commented: array[a] = input.nextInt(); when i use this, it give me more erros +0
masijade 1,351 Industrious Poster Team Colleague Featured Poster
Malaka_1 0 Newbie Poster
masijade 1,351 Industrious Poster Team Colleague Featured Poster
Malaka_1 0 Newbie Poster
masijade 1,351 Industrious Poster Team Colleague Featured Poster
stultuske 1,116 Posting Maven Featured Poster
Malaka_1 0 Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.