Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

Java support call by reference (pass by reference) ?

Answer Posted / sarju001

yes java support call by reference only using StringBuffer
class.

Here, is an example of call by reference

public class PassByReference
{
public static void passref(StringBuffer s)
{
s = s.insert(8, "j2ee & ");
System.out.println(s);
}
public static void main(String[] args)
{
StringBuffer str = new StringBuffer("Welcome java
program");

System.out.println(str);

passref(str);

System.out.println(str);
}
}


output :-

Welcome java program
Welcome j2ee & java program
Welcome j2ee & java program

Is This Answer Correct ?    9 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What does flagged out mean?

1012


what type of questions asked for barclays technologies pune please send urgent

5618


What is private protected in java?

997


Define array. Tell me about 2-D array.

1004


What are variable arguments or varargs?

963


What is the differences between c++ and java? Explain

1003


How many types of string data types are there?

1032


What is compiler and what its output.

1084


Where are register variables stored?

974


What is boolean false?

934


write a program that list all permutations of ABCDEF in which A appears before B?

2442


What kind of variables can a class consist?

1003


What is a method signature java?

994


Name some OOPS Concepts in Java?

1026


What is better - 'bit-shift a value' or 'multiply by 2'?

1124