goto();

This is where you talk about the NXJ software itself, installation issues, and programming talk.

Moderators: 99jonathan, roger, imaqine

goto();

Postby NadirHajiyev » Fri Jul 13, 2012 11:57 am

Hello guys.
Could anyone explain (or give any source about)
Code: Select all
goto();
keyword and how use it in leJOS?
I googled it but could not find anything useful.
Thanks.
NadirHajiyev
New User
 
Posts: 20
Joined: Thu Jul 05, 2012 10:25 am

Re: goto();

Postby skoehler » Fri Jul 13, 2012 12:01 pm

Goto is not a Java keyword. The could you pasted is pretty useless without context. But it clearly is a method call. The code is equivalent to
Code: Select all
this.goto();


So obviously, the class from which you copied that code must have a goto() method or it has inherited the goto() method from its superclass.
skoehler
leJOS Team Member
 
Posts: 1350
Joined: Thu Oct 30, 2008 4:54 pm

Re: goto();

Postby genom2 » Fri Jul 13, 2012 9:22 pm

Isn't 'goto' a reserved keyword in JAVA? (A keyword reserved during the early days of JAVA for potential future use. But until then never got a semantic in JAVA. So it's just reserved until today.)
So writing
Code: Select all
goto();

or
Code: Select all
goto label1;

is not allowed in JAVA.
Last edited by genom2 on Fri Jul 13, 2012 9:29 pm, edited 1 time in total.
genom2
New User
 
Posts: 6
Joined: Tue Nov 08, 2011 11:01 pm

Re: goto();

Postby skoehler » Fri Jul 13, 2012 9:28 pm

Yes, you're right. Didn't know that. So then goto is a reserved keywords in Java. It's simply reserved, but doesn't have a meaning in Java.
http://stackoverflow.com/questions/1334 ... rd-in-java
skoehler
leJOS Team Member
 
Posts: 1350
Joined: Thu Oct 30, 2008 4:54 pm


Return to NXJ Software

Who is online

Users browsing this forum: Yahoo [Bot] and 2 guests

more stuff