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

what is encapsulation in java? Explain

0 Answers  


how we can make a write-only class in java?

0 Answers  


What is the difference between a loader and a compiler?

0 Answers   Syntel, Visa,


What do you mean by thread safe?

0 Answers  


What is the exception hierarchy in java?

0 Answers  


What is functional interface in java?

0 Answers  


Difference between this() and super() in java ?

0 Answers  


is java support call by reference and call by value, if supports please explain?

5 Answers  


What is instanceof keyword?

0 Answers  


what is stringtolennizer with example?

2 Answers   Symphony,


What is the use of System class?

0 Answers  


Why const and goto are reserved keyword in java?

1 Answers  


Categories