Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Printing to Console  RSS feed

 
stab cooper
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can anyone help with the code for printing a password and username to console.I have my passwordField pas with an action listener but wnat to get it printined to the console. Using version JDK1.5.Have tried some of the methods in the documentation but am getting errors.

Please help
 
Kaydell Leavitt
Ranch Hand
Posts: 690
Eclipse IDE Firefox Browser Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What errors are you getting. Compile-time errors or run-time errors. Also, what is your code?

In general, you print to the console using: System.out.println(string) or System.out.print(string). If what you are printing is not a string, then you can override toString() for your class and the object will automatically be converted to a string as needed.

-- Kaydell
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!