Saturday 16 March 2013

calling of main() only


main()
    {
    main();
    }
Answer:
 Runtime error : Stack overflow.
Explanation:
main function calls itself again and again. Each time the function is called its return address is stored in the call stack. Since there is no condition to terminate the function call, the call stack overflows at runtime. So it terminates the program and results in an error.


Blog Author: Vijay Kumar

Go to: Java Aptitude


No comments:

Post a Comment