Java new Batch - Class 10- why call by value is possible in java and why not call by reference?

preview_player
Показать описание
You can learn Java with me as the Java Programming language is being made easily. It would take a period of minimum three months and maximum 6 months to master Java. I would recommend you to watch all my videos to crack any software interviews that would require Java Programming language as a primary skill.

20. Why java follows only call by value parameter passing mechanism
whereas C and C++ follows both call by value and call by reference passing mechanism ? why?

What is parameter passing mechanism in programming languages?
if any Programming language , if we pass Primitive data types as parameters in the methods, it is called as call by value parameter passing mechanism

ex : byte, short , int ,long, float, double, char, boolean

Please be informed that call by reference is not supported by java, in call by reference we need to pass addresses which are stored in the form of pointers. However, pointers concept is not there in java due to security reasons. Hence, java does not support call by reference parameter passing mechanism.
Рекомендации по теме
Комментарии
Автор

Notes are attached in the description

JavaInterviewQuestions