| | |
findInLine(“.”)charat(0);
![]() |
•
•
Join Date: Sep 2008
Posts: 8
Reputation:
Solved Threads: 0
Java Syntax (Toggle Plain Text)
import java.util.Scanner; class ReverseWord { public static void main(String args[]) { Scanner myScanner = new Scanner(System.in); char c1, c2, c3, c4; c1 = myScanner.findInLine(“.”).charAt(0); c2 = myScanner.findInLine(“.”).charAt(0); c3 = myScanner.findInLine(“.”).charAt(0); c4 = myScanner.findInLine(“.”).charAt(0); System.out.print(c4); System.out.print(c3); System.out.print(c2); System.out.print(c1); System.out.println(); } }
the code above if you type
stop
in the windows prompt window will put the output of
pots
but im wondering what this part does
charAt(0);
at what would happen if i changed it to
charAt(1);
thanks, i know what the rest does though.
Why don't you try it and find out?
I'm sorry, but you claim to be jumping into Java quickly, on your own, because you already know a couple of other languages. Well, I need to ask, what "other languages" do you know? Because in that thread you had no idea what "static" was and in this thead, the method you are looking at is extremely self-explanatory if you have nearly any real programming experience at all.
I'm sorry, but you claim to be jumping into Java quickly, on your own, because you already know a couple of other languages. Well, I need to ask, what "other languages" do you know? Because in that thread you had no idea what "static" was and in this thead, the method you are looking at is extremely self-explanatory if you have nearly any real programming experience at all.
Java Programmer and Sun Systems Administrator
----------------------------------------------
Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
----------------------------------------------
Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
•
•
Join Date: Sep 2008
Posts: 8
Reputation:
Solved Threads: 0
•
•
•
•
Why don't you try it and find out?
I'm sorry, but you claim to be jumping into Java quickly, on your own, because you already know a couple of other languages. Well, I need to ask, what "other languages" do you know? Because in that thread you had no idea what "static" was and in this thead, the method you are looking at is extremely self-explanatory if you have nearly any real programming experience at all.
i got the code off a pdf file whats helping me learn, when i tested it i found 20 errors, witch is probably becasue the books pretty old. and i didint have the time today inbetween reading and working with my brother on his truck so i didint get the time to look into the problems.
plus even if i did test it i may not get the answer im looking for.
Last edited by nojtb; Sep 11th, 2008 at 3:08 am.
First, the API docs, every Programmers best friend.
http://java.sun.com/javase/6/docs/
Second, the official Tutorials, every beginning Programmers second best friend.
http://java.sun.com/docs/books/tutorial/index.html
Third Bruce Eckels "Thinking In Java" 3rd Edition (the 4th Edition is not completely available online, yet).
http://www.mindviewinc.com/downloads...edition4.0.zip
http://java.sun.com/javase/6/docs/
Second, the official Tutorials, every beginning Programmers second best friend.
http://java.sun.com/docs/books/tutorial/index.html
Third Bruce Eckels "Thinking In Java" 3rd Edition (the 4th Edition is not completely available online, yet).
http://www.mindviewinc.com/downloads...edition4.0.zip
Java Programmer and Sun Systems Administrator
----------------------------------------------
Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
----------------------------------------------
Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
•
•
Join Date: Nov 2009
Posts: 1
Reputation:
Solved Threads: 0
0
#6 18 Days Ago
this is the mistake:
in you must have instead of
in
Java Syntax (Toggle Plain Text)
findInLine(“.”)
Last edited by valy0017; 18 Days Ago at 5:13 am. Reason: wrong cODE TAG PLACEMENT
![]() |
Similar Threads
- If else statements on compatibility, I'm so confused here????? (Java)
- decimal & fraction (Java)
- I need help (Java)
Other Threads in the Java Forum
- Previous Thread: Reading in from files?
- Next Thread: Creating a ToolTip on a Rectangle
| Thread Tools | Search this Thread |
911 addball addressbook android api append applet application apps array arrays automation binary bluetooth businessintelligence button card chat class client code collision component crashcourse css csv database eclipse ee error fractal free game gis givemetehcodez graphics gui html ide image input integer integration j2me japplet java javaarraylist javadoc javafx javaprojects jni jpanel julia jvm linux list loan loop machine map method methods migrate mobile netbeans newbie objects oriented output panel phone physics problem program programming project radio recursion reporting scanner se server service set sms socket software sort sql string swing test textfield threads transfer tree trolltech ubuntu utility windows






