• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Method Parameter/Argument Question

 
marcus conway
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
I have a method:

What I'm trying to do is obtain input from the user and set their input as the 'String id' parameter in the above Cube(String id, String faceValues) method:

 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not sure what your question is, but your code above is not doing anything with the String returned by scan.next(). I'm guessing you'll want to assign these to some variables so that you can pass them to a Cube constructor.
 
marcus conway
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by marc weber:
I'm not sure what your question is, but your code above is not doing anything with the String returned by scan.next(). I'm guessing you'll want to assign these to some variables so that you can pass them to a Cube constructor.


Yes, thats correct. I want to pass them to the ...
Can you explain how to pass the two variables to parameters?


Thanks a lot
 
Don Solomon
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't know where to begin. First, that is not a method, but it is a constructor. The toUpperCase() method doesn't do anything to the string. You have to capture the return value. I haven't figured out what you are doing with Random.

Find a good book and start from there.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic