Can i write sin(whatever) in Java and have it work?
public static void main(String[] args) {
try {
double check = Double.parseDouble(args[0]);
} catch (NumberFormatException e) {
System.exit(0);
}
sin(args[0]);
}
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If you are running anything below Java 1.5, no. If you aren’t, you can, using static imports; you can write
import static java.lang.Math.*;and thensin(whatever);and this is OK. Be aware of the warning from Sun, though:If you happen to be running something below Java 1.5, you can still write
sin(whatever), but this method must be present…