173k views
3 votes
True of False - use T or F The Math class can be instantiated.

User Kajol
by
4.9k points

1 Answer

4 votes

Answer:

F

Step-by-step explanation:

The Math class cannot be instantiated because it has a private constructor.

However all the methods in the java.lang.Math are static which means that you can invoke them directly without having to instantiate the class. For example:

static int abs(int a) defined in the Math class can be invoked from the calling function as:

int absolute_value = Math.abs(a);

Note that the class Math is also declared as final which means it cannot be extended by any other class as well.

User Dsharew
by
4.3k points