213k views
2 votes
Method that would be free functions in _________(not members ofany class) should be static method in _________.

Java , C#
C++ , C#
Java , C++
C++ , Java

User CtheGood
by
5.0k points

2 Answers

2 votes

Answer:

C++,Java

Step-by-step explanation:

Free functions or non-member functions in C++ do not require a class to be instantiated prior to their invocation.

Java provides a similar concept in terms of static methods. Static methods can be invoked without instantiating the object by prefixing the class name before the method name. For example:

Math.max()

Integer.parseInt()

String.valueOf()

Class.forName()

User Daionne
by
5.3k points
7 votes

Answer:

C++,Java

Step-by-step explanation:

Free functions or non-member functions in C++ do not require a class to be instantiated prior to their invocation.

Java provides a similar concept in terms of static methods. Static methods can be invoked without instantiating the object by prefixing the class name before the method name. For example:

Math.max()

Integer.parseInt()

String.valueOf()

Class.forName()

User Ledawg
by
5.4k points