Do you mean somthing like this?
Code:public class Q{ public static void main(String[] args){ double d = 1.5; Z[] z = {new Z()}; long l = z[0].round(d); System.out.println(" The value of " + d + " rounded " + " = " + l); } } class Z{ public long round(double d){return Math.round(d);} }




Reply With Quote