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

how come we know the object is no more used in the class?

2 Answers   Accenture,


Is a method a function?

0 Answers  


What is singleton class in ruby?

0 Answers  


Explain your academic project?

2 Answers   Accenture, Levonsys, SDF, TCS, Tech Mahindra,


is JVM platform dependent or independent..?

11 Answers   IBM, Tech Mahindra,


Which java version is latest?

0 Answers  


How many types of syncronization?

2 Answers  


Explain cookies?

2 Answers   Canon,


extending thread class or implementing runnable interface. Which is better? : Java thread

0 Answers  


What is numeric data type?

0 Answers  


what is the difference between a java object reference and c++ pointer?

4 Answers  


What is garbage collection? Can it be forced to run?

0 Answers   Global Logic,


Categories