ChapterFivePartIII

This is referred to as ambiguous invocation ambiguous

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: specific match. This is referred to as ambiguous invocation. Ambiguous invocation is a compilation error. Ambiguous Invocation public class AmbiguousOverloading { public static void main(String args) { System.out.println(max(1, 2)); } public static double max(int num1, double num2) { if (num1 > num2) return num1; else return num2; } public static double max(double num1, int num2) { if (num1 > num2) return num1; else return num2; } } The Math Class Class constants: • PI •E Class methods: • • • • Trigonometric Methods Exponent Methods Rounding Methods min, max, abs, and random Methods Rounding Methods double ceil(double x) x ro...
View Full Document

Ask a homework question - tutors are online