1] While declaring the function sir used private instead of public.
2] Sir also used [ ] [ ] in the function definition outside the ( ) .
What’s the reason as we were creating functions while declaring the parameters inside ( ) .
Take Input And Display In 2-D Array
Hi @mananaroramail,
The answer to your first doubt is that private functions can be only by the main function of the respected class and not by any other class so this created safety or in other words it is a property of OOPS (object oriented programming ) to protect the data from external manipulation…So to make sure of that we use private.
Other question is unclear … if you are talking about brackets in private static int [][] takeInput() then they are because of return type is a two dimensional array.
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.