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 are order of precedence and associativity, and how are they used?

1 Answers  


Which eclipse is best for java?

0 Answers  


How do you use, call, and access a static method in Java?

2 Answers  


What is the difference between this() and super()?

15 Answers   TCS,


what is main difference between architecture,framework and design pattren

3 Answers  


what r advatages of websphere? & how to deploy?

0 Answers   Saksoft,


What part of memory - Stack or Heap - is cleaned in the garbage collection process?

1 Answers  


What do you understand by the term singleton?

0 Answers  


Is set ordered in java?

0 Answers  


what is the use of private constructor in core java?

3 Answers   OnMobile, Satyam, Yash Technologies,


how a marker interface gets its functionality and when we implements a marker interface how it got invoked

3 Answers   Mind Tree,


What is stored procedure. How do you create stored procedure ?

0 Answers   GE,


Categories