@ what i've done wrong in this solution according to this exercise create an aplication in Java that reads 2 numbers as input and then calculates and bills maximums minimums and average of these 4numbers ..solve this using Math methods ..please help me i'm a beginner import java.math.*; public class prove { public static void main(String[] args) { String name =args[0]; String name2=args[1]; int b=Math.max(name,name2); } }
You're passing Strings to the Math.max function. The command line arguments are strings, you're assigning them to strings, and then trying to do math on them. At the least, your results will be interesting. As you're assigning the args to name and name2, convert them to ints, and make name and name2 int.
type casting is your problem my friend
@rsmith i want to use run cofiguraton my arguments and args cannot be resolved to a variable
int as you said
Join our real-time social learning platform and learn together with your friends!