1 Replies - 206 Views - Last Post: 07 October 2012 - 09:14 AM Rate Topic: -----

#1 MR.  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 15-January 11

RangeLister Java Application (Problem)

Posted 07 October 2012 - 09:07 AM

I Am Making RangeLister Program And Below Is My Part Of Program And Problem:
class RangeLister {
	int[] makeRange(int lower, int upper) {
		int[] range = new int[(upper-lower) + 1];
		
		for(int i = 0; i < range.lenght; i++) {
			range[i] = lower++;
		}
		return range;
	}
	
	public static void main(String[] arguments) {
		int[] range;
		RangeLister lister = new RangeLister();
		
		range = lister.makeRange(4, 13);
		System.out.println("The array: [ ");
		for(int i=0;i<range.lenght;i++) {
			System.out.print(range[i] + " ");
		}
		System.out.println("]");
	}
}

I Have Error On Line 5: cannot find symbol
for(int i = 0; i < range.lenght; i++)

And Same Error On Line No. 17
I would be very thankful for solving my problem as early as possible.

Is This A Good Question/Topic? 0
  • +

Replies To: RangeLister Java Application (Problem)

#2 Kinaces  Icon User is offline

  • D.I.C Head

Reputation: 78
  • View blog
  • Posts: 230
  • Joined: 04-October 12

Re: RangeLister Java Application (Problem)

Posted 07 October 2012 - 09:14 AM

Check your spelling on length. :)
Was This Post Helpful? 2
  • +
  • -

Page 1 of 1