hi there....recently a friend of mine asked me to convert a c++ coded pgm to java codes....
and there was a macro [#define f(x) x*x*x+6*x* ]
i thought of using a function call ..but it would be undesirable for this pgm
how do i get a java equivalent for this ....

You could code a static method for it in a utility class

public class Functions{
  public static float f(float x){
    return x*x*x+6*x;
  }
}

Anything you do is going to be a method call. You don't need to create any references to use the above, but then again you give up other flexibility with that.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.