Error
// package ClassObjectsandMethod; class Methodoperator { static float mul(float x,float y) { return x*y; } static float div(float x,float y) { return x/y; } } public class StaticMember { public static void main(String[] args) { float a = Methodoperator.mul(4.0,5.0); //Why an error here float b = Methodoperator.div(a,5.0); //& here } } Why this error show .... StaticMember.java:15: error: incompatible types: possible lossy conversion from double to float float a = Methodoperator.mul(4.0,5.0); ^ StaticMember.java:16: error: incompatible types: double cannot be converted to Float float b = Methodoperator.div(4.0,5.0); ^ Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output 2 errors