+ 12

What is the need of using functions??

2nd Jan 2018, 8:41 AM
Neelarghya Kundu
Neelarghya Kundu - avatar
4 Answers
+ 12
Well methods(or functions as you call them) are fundamental in java, every code must have at least one method(the main method) Methods are a collection of statements that perform a particular task, they are useful mostly because they can be reused
2nd Jan 2018, 9:16 AM
David Akhihiero
David Akhihiero - avatar
+ 19
suppose u want to use a method getResult () multiple times at different or same sections of the code , will u write the full algorithm of that method getResult() again and again at different places ... wouldn't it be tedious & waste your time also ? ... even if u copy & paste then it will increase code size it would be smart to make a {function/method getResult ()}definition only once & use it just in different sections of code by method call //hope it helpsā˜ŗ
2nd Jan 2018, 11:55 AM
Gaurav Agrawal
Gaurav Agrawal - avatar
+ 8
thanks for your repliesšŸ˜ŠšŸ˜ŠšŸ˜Š
4th Jan 2018, 3:28 PM
Neelarghya Kundu
Neelarghya Kundu - avatar
- 3
B:hhghgBn;buggy njhhuyjhijhjhBtFbTG
6th Jan 2018, 6:05 AM
Po Heng Ko
Po Heng Ko - avatar