In Java, the kind of equivalent of "#include <header>" is an import statement. The syntax is as follows:
import
package;
There is one package that you don't need to include and that's java.lang, which is included automatically.
In java.lang, you have a class called Math. I haven't done much C, but structs are kind of like classes (at least, C++ classes are like structs in C). The square root function, sqrt(double x) is a static method of that class. What that basically means is you don't need to use that function on a particular instance of that class - it's ok to use the class name to call the function.
Let me show you a quick example of using the square root function:
Code:
// Do we need "import java.lang" here? No, because
// it's included by default.
public class Test
{
public static void main(String[] args)
{
double x = 5;
double sqrtX = Math.sqrt(5);
}
}
Does that help at all? I've not touched Java for a while actually and I'm surprised I'm able to remember this stuff!