cannot be applied to (int)
i've been splitting my hairs at this all night.
any help would be great!
need answers quick...
i'm getting a compile error:
E:\java\Methods.java:36: getValidMaxNum() in Methods cannot be applied to (int)
userNum = getValidMaxNum( userNum );
^
E:\java\Methods.java:38: cannot find symbol
symbol : variable getValidMaxNum
location: class Methods
System.out.println( getValidMaxNum );
^
2 errors
Tool completed with exit code 1
here is the source code for the errors:
import java.io.*;
import java.util.Random;
public class Methods
{
public static void main( String[] args )
{
final int MAX_NUM;
int ranNum1,
ranNum2,
ranNum3,
ranNum4,
ranNum5,
userNum,
numPoints;
MAX_NUM = userNum ++;
dispOpenMsg();
userNum = getValidMaxNum( userNum );
System.out.println( getValidMaxNum );
/* Generates The Random Numbers */
Random ranGenerator = new Random( );
ranNum1 = ranGenerator.nextInt( MAX_NUM );
ranNum2 = ranGenerator.nextInt( MAX_NUM );
ranNum3 = ranGenerator.nextInt( MAX_NUM );
ranNum4 = ranGenerator.nextInt( MAX_NUM );
ranNum5 = ranGenerator.nextInt( MAX_NUM );
calcPoints ( ranNum1, ranNum2, ranNum3, ranNum4, ranNum5 );
dispResults ( ranNum1, ranNum2, ranNum3, ranNum4, ranNum5, numPoints );
}//End main
.....
public static int getValidMaxNum()
{
int userNum = 0;
InputStreamReader reader = new InputStreamReader ( System.in );
BufferedReader console = new BufferedReader ( reader );
String numStr = " ";
boolean isValidNum = false;
/* do statement */
do
{
/* try statement */
try
{
/* Title And Input */
System.out.println();
System.out.println( "Directions Are" );
System.out.print( "Enter A Positive Number: " );
numStr = console.readLine( );
userNum = Integer.parseInt( numStr );
/* number */
if( userNum > 0 )
isValidNum = true;
else
if ( userNum < 0 )
System.out.println( "Please No Negative Numbers" );
}//End try
/* number catch */
catch( NumberFormatException numErr )
{
System.err.println( "That's not an Integer!" );
}//End NumberFormatException catch
/* general catch */
catch( Exception genErr )
{
System.err.println( "Please, Try Again!" );
}//End Exception catch
/* while */
}
while ( !isValidNum );
return userNum;
}//End getValidMaxNum

