Skip to content

Instantly share code, notes, and snippets.

@ghtali
Last active December 27, 2017 01:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ghtali/cbea2706cc670940ee5859e635198acc to your computer and use it in GitHub Desktop.
Save ghtali/cbea2706cc670940ee5859e635198acc to your computer and use it in GitHub Desktop.
Call to a void method Java
import java.lang.reflect.Method;
public class Example {
public static void main(String[] args) {
// TODO Auto-generated method stub
MethodRankPoints(19.9);
}
public static void MethodRankPoints(double points) {
if(points >= 22.1) {
System.out.println("Rank A");
}else if(points >= 19.8) {
System.out.println("Rank B");
}else {
System.out.println("Rank C");
}
}
}
//A personal training, source: https://www.tutorialspoint.com
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment