aspose file tools*
The moose likes Cattle Drive and the fly likes Need some help with my first assignment Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » This Site » Cattle Drive
Bookmark "Need some help with my first assignment" Watch "Need some help with my first assignment" New topic
Author

Need some help with my first assignment

Shon Shalit
Greenhorn

Joined: Jul 16, 2010
Posts: 1
Hey, i'm a complete java newbie, i took a C++ class a year ago, and i did pretty well, so i know my way around loops. i already made a for loop that will run 100 times, the only problem now is i don't know the code that would allow the user to input something for the app to print.(i think in C++ it was called cin)

thanks in advance
Gary Ba
Ranch Hand

Joined: Oct 23, 2009
Posts: 153

Try using the String parameter from your main() and see if that works.
Or maybe use BufferedReader?

star chaser..
Carol Murphy
village idiot
Bartender

Joined: Mar 15, 2001
Posts: 1195
From the command prompt if you are in your development directory just type:
java nameofapp argument

The string you have provided as the argument is passed into main and if your code runs as anticipated, all should be well
Michael Angstadt
Ranch Hand

Joined: Jun 17, 2009
Posts: 273

You can get command-line parameters using the "args" array (sort of like in C++). To get user input while the program is running you can use the Console class (call System.console()).


SCJP 6 || SCWCD 5
Janeice DelVecchio
Saloon Keeper

Joined: Sep 14, 2009
Posts: 1665
    
  11

Shon --
There are links on the page with the assignment with tutorials. The one you're going to need is: http://www.javaranch.com/drive/command.html

Most assignments have some hints included in them or as links. Keep your eye out!


When you do things right, people won't be sure you've done anything at all.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Need some help with my first assignment