arguments Archive

Pass by reference vs Pass by value in java

Pass by value Methods become very poewerful by using parameters.  In method signature a number of  paramters of primitive data type can be defined. When calling a method you must have to provide arguments. For example, the following program print n value and int n is a formal parameter in this method and will accept

Creating a method in Java

Creating a method in Java A method is a set of statements grouped together to perform an operation. Generally there are two types of methods. User defined methods : Usually a user creates to add additional functionality Predefinde methods :  Such methods are already written and provided by java such as Math.pow() General syntax for