I am working on a project and ha开发者_JAVA技巧ve the following psuedocode:
// create a private method, getIntValDialog, that returns an integer value and accepts
// two string values as arguments
// declare and initialize a string variable, sValue, to an empty string
// Accept input to sValue from a Input Dialog using smessage, stitle, and a question icon as arguments
// return the integer converted value of sValue
// end getIntValDialog method
I have an idea, but I don't quite understand how to set this up properly. The psuedocode tells me what I have to do, but I just need some help understanding and visualizing how this works. Any help would be appreciated :)
Here's what I get out of your pseudo-code:
// create a private method, getIntValDialog, that returns an integer value and accepts
// two string values as arguments
private int getIntValDialog(String smessage, String stitle)
{
// declare and initialize a string variable, sValue, to an empty string
String sValue = "";
// Accept input to sValue from a Input Dialog using smessage, stitle,
// and a question icon as arguments
// TODO (this is your part of the task)
// return the integer converted value of sValue
return Integer.valueOf(sValue);
// end getIntValDialog method
}
You take it from here.
I have an idea, but I don't quite understand how to set this up properly.
Some advice for future questions: If you truly do have an idea, please post it as best you can and let people correct any errors. It'll show good faith effort that you're working.
精彩评论