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) ?



Java support call by reference (pass by reference) ?..

Answer / 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

More Core Java Interview Questions

Are arrays passed by reference in java?

0 Answers  


What is a singleton class in Java? And How to implement a singleton class?

2 Answers  


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

0 Answers  


How can an object be unreferenced?

0 Answers  


What is bubble sorting in java?

0 Answers  


What is a class variable?

0 Answers  


What is Runtime class and its purpose?

2 Answers  


Which list does not allow duplicates in java?

0 Answers  


What does split function do in java?

0 Answers  


Which command from the jdk compiles a java program?

0 Answers  


What is the difference between menuitem and checkboxmenu item?

0 Answers  


What is the purpose of having the concept of overloading?

7 Answers   Ness Technologies,


Categories