<h2>This function will land up in infinite function call</h2>
Explanation:
first time when the function gets invoked,
f(6,8), so k=6 & n=8, inside the function it checks k==n, ie. 6==8, returns false, then one more if is available, so 6>8 is check for , once again it is false and else loop is executed, the function is called recursively using f(k-n,n), that is f(6-8,8), it means f(-2,8) is passed.
Second time,
if(-2==8) is false, so if(-2>8) is again false and function f(-10, 8) is called
if(-10==8) is false, so if(-10>8) is again false and function f(-18,8) is called
if(-18==8) is false, so if(-18>8) is again false and function f(-26,8) is called
So this goes recursively and ends in an infinite function call.
Answer:
Option I.
Explanation:
(I) Option (I). is true. If a class accepts different argument type and the argument type provided is different then it will throw a error. The argument type provided and the argument expecting has to match for the compilation of the program without an error. So, option (I) is true.
(II) Option (II). is false. If the method doesn't return any value then the method declaration contains as the return type.
(III) Option (III) is false. The method random() returns a double value with the number between 0.0 and 1.0 with 0.0 included in the range but 1.0 is not included in the range. The method returns value with positive side but not the negative side.