read keyboard input and storing in an array?



Hey all,
New to this, so apologies for the presumably basic question:

I'm trying to store user input in an array, marks. Here's my [cut down]
code:

public class MarksDatabase
{
private int marks[];

public MarksDatabase(String moduleName) {
int[] marks = new int[200];
}

public static void readMarks() {
Scanner keyboard = new Scanner(System.in);
System.out.println("Enter marks, then put -1 blah blah");
marks[] = keyboard.nextInt();
}

I get an error with the keyboard.nextInt part. I've probably
misunderstood my instructions, but can anybody explain to me where I'm
going wrong?

Matt

.



Relevant Pages

  • Re: Can anyone help me answer these questions or nay of them as im struggling with understanding the
    ... (10 marks) ... b/ To demonstrating the use of a FOR loop write a short section of VBA ... code to add up the first 10 elements in the array Data(). ... Dim dataAs Single ...
    (microsoft.public.excel.programming)
  • How to calc teechart positions?
    ... I'm using a teechart (v4.04 standard with Delphi 7) in the following way: ... procedure TXyz.DisplayNewStatistics(data: Array Of Integer); ... The list of Marks is empty. ... option too (the mark positions are present at that time) because they are ...
    (borland.public.delphi.thirdpartytools.general)
  • Max no of ticks on X-axis?
    ... What is the maximum number of ticks (marks) you can have ... on the X-axis of a line-chart? ... I have an array that is dynamically dimensioned and the ...
    (microsoft.public.excel.charting)
  • Re: How to label points in plot function?
    ... "If 'string' is an array the same number of rows as the ... TEXT marks each point with the corresponding ... Prev by Date: ...
    (comp.soft-sys.matlab)