This week's giveaway is in the Spring forum.
We're giving away four copies of REST with Spring (video course) and have Eugen Paraschiv on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes beginner Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "beginner" Watch "beginner" New topic


prans rao

Joined: Aug 08, 2008
Posts: 9
I am coming with a
As joe ess said i tried to print the lenth of "s" as
class cbr
int a,b;
void read(int x,int y)
void swap(cbr x1)
int t=x1.a;
void display()
System.out.println(a+" "+b);
public static void main(String []s)
System.out.println("s has "+s.lenght+" elements");
cbr c=new cbr();
int a1=Integer.parseInt(s[0]);
int a2=Integer.parseInt(s[1]);,a2);
System.out.println("Before swap");
System.out.println("After swap");

But i am getting error as cannot resolve symbol "s".
what to do
please suggest me as soon as possible.
venkatesh badrinathan
Ranch Hand

Joined: Aug 03, 2008
Posts: 77
Hi prans,
i think the problem is not with your concept but your spelling for 'length'
check out in this line,
System.out.println("s has "+s.lenght+" elements");
Furthur the compiler did not report like what you have said..

fred rosenberger
lowercase baba

Joined: Oct 02, 2003
Posts: 11923

read the error more closely. what it actually says is: cannot find symbol
symbol : variable lenght
location: class java.lang.String[]
System.out.println("s has "+s.lenght+" elements");

There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
I agree. Here's the link:
subject: beginner
It's not a secret anymore!