184k views
0 votes
Empty parentheses following a function name in a function definition indicate that the function does not require any parameters to perform its task.

User DanArl
by
5.9k points

1 Answer

4 votes

Answer:

This statement is correct.

Explanation:

If a function does not have any parameters, then we can create the variable inside the function which will be private and call the function from the main function.

If we specify any return type like int, float or char, etc then we need to declare a return value from the function.

But If we specify the Void then we don't need to return value inside the function, we can directly print the value inside function.

Ex.

void add()

{

int a=7;

int b=9;

int c=a+b;

System.out.println("the added value is :"+c);

}

User Albert
by
5.4k points