[program-java] Re: illegal start of type help required

  • From: "Roger Woolgrove" <rawoolgrove@xxxxxxxxxxxxxx>
  • To: <program-java@xxxxxxxxxxxxx>
  • Date: Wed, 2 Mar 2011 18:09:36 -0000

   Hi again,

Issue is resolved and I forgot to put it in the braces - doh!

Thanks for any assistance and apologies for wasting that time.

I'll buy you a beer in gratitude should we ever meet.

Roger



Please ignore my last.  I seem to have the old trouble of only knowing what I 
am doing once I've asked someone.
  ----- Original Message ----- 
  From: Roger Woolgrove 
  To: JavaProgramming 
  Sent: Wednesday, March 02, 2011 5:23 PM
  Subject: [program-java] illegal start of type help required


  Hi all,

  This is probably a real easy one but here goes.
  I am writing a constructor and get the subject as an error when compiling.

  My constructor is as follows:
  Public int[] cast = new int[valueFour];
  // valueFour is a pre-determined value (int)
  // array needs to be length of valueFour and not valueFour+1
  for (int count = 0; count < cast.length(); count ++)

  // if .length does not require () that is not issue as have tried both but 
can't remember whether required or not
  {
  this.cast[count] = valueTwo;
  }

  The error is with the for line, any ideas?

  Many thanks

  Roger

Other related posts: