suggest me....

Dani AI

Generated

Short clarification and practical steps.

As noted, Java has no runtime goto operator (the token is reserved), so a literal goto(x,y) is not a built-in Java construct. As and suggested, similarly named routines historically came from terminal or legacy languages to move the cursor or to perform jumps, not from the Java language itself.

How to identify what the symbol actually is in an Eclipse project: Open Declaration (F3) or Ctrl+Click on the name to jump to its definition; hover to see quick Javadoc; inspect the file's import lines to find the declaring class; use Java Search or File Search (Ctrl+H) for the method name across the workspace; expand Referenced Libraries in Package Explorer to inspect JARs (install a class-decompiler plugin if no source is attached); check Call Hierarchy to see who invokes it; examine the build tool dependency tree (Maven/Gradle) if the project uses one. If no declaration is found, the snippet may be from another language or from an external API not on the classpath.

Common Java ways to achieve coordinate-style behavior (depending on intent): component positioning via setLocation(x,y) or setBounds(x,y,w,h) (but prefer layout managers); custom drawing in paintComponent(Graphics) with g.drawString(...) or g.drawImage(...); moving the OS pointer with Robot.mouseMove(x,y); terminal cursor control via ANSI escape sequences or a terminal library (e.g., Jansi/Lanterna) for portability. These steps should reveal whether the token is a third-party API, legacy code, or simply not Java.

Recommended Answers

All 8 Replies

It' looks like a method. Which class did you find it in?

According to the JLS goto is a reserved word, so the answer to "what use is goto(x,y)?" Is "you use it generate a compile-time error".

I believe it was used in Turbo C and Turbo Pascal in the previous century. It adresses the terminal's screen positions.

Goto sounds to an old way to do jumps in the code. This was substitute a long time ago for conditionals (if).

@Raul Perez: in case you did not notice, this thread is not about a goto statement, but about a "screen coordinate specifier". If my memory serves me well it was even called gotoxy(X,Y) instead of goto(X,Y), but small dialect differences (with no standards) could always sneak in back in those middle age days. :)

: you are right, I was trying to give the matter another point of view in case our friend needed.

To be fair, the assumption about it being a console command is just that, an assumption. There's absolutely nothing from the OP that even hints about console. Maybe it's a graphics command, maybe it selects coordinates for viewing a location in Google Earth.
The only thing we can be sure of is that it's not Java

@James: most of the terminals in the 70 80ties where not what I would call graphical. So I may be terribly wrong but IMHO the OP is referring to something like this. and you are absolutely correct, it is not Java or whatever. It is history. But it's a pity it is still in use on this planet.

Maybe he is, but that's a guess based on zero evidence. OP says nothing to indicate that particular use of a goto method. A quick google excluding the irrelevant gotoxy first comes up with uses in the Turtle teaching language and the ArcGIS geographical data analysis package. Let's keep an open mind and wait to see if he ever comes back.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.