Newbie Question

From: George (replytogroup_at_group.com)
Date: 03/23/04


Date: Tue, 23 Mar 2004 12:51:56 -0000

Hi
I trying to initialize an Array with int's and want to print the output as
tha Array is filled but I'm getting the two errors below. Could someone
please point a lost sheep in the right direction.

public class SomeClassTest{

  public static void main(String[] args) {
  int [] v;
  v = new int[10];
  for (int i = 0; i< v.length; i++);
  v[i] = i; // error 300 variable i
not found in class SomeClassTest
  System.out.println("" + v[i] ); // error 300 variable i not found in
class SomeClassTest

  }
}

TIA

George



Relevant Pages

  • Re: Newbie Question
    ... >I trying to initialize an Array with int's and want to print the output as ... >tha Array is filled but I'm getting the two errors below. ... the variable i is out of scope. ... >not found in class SomeClassTest ...
    (comp.lang.java.help)
  • Re: Newbie Question
    ... > tha Array is filled but I'm getting the two errors below. ... Your variable is defined at the first hat, ... > not found in class SomeClassTest ... int v; ...
    (comp.lang.java.help)
  • Re: Newbie Question
    ... "Andrew Thompson" wrote in message ... >> tha Array is filled but I'm getting the two errors below. ... > Your variable is defined at the first hat, ... >> not found in class SomeClassTest ...
    (comp.lang.java.help)