Explain pass by reference and pass by value?

Answer Posted / chinmay

passing the value instead of reference is known as pass by value,here primitive data should be given...
now pass by reference
Demo d=new Demo("abc");
Demo c=b;
here we pass the reference instead of value..
it is called pass by reference

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why to use nested classes in java? (Or) what is the purpose of nested class in java?

508


What is the difference between path and classpath variables?

513


What is volatile keyword in java

632


How is the marker interface used in Java?

595


What are the advantages of arraylist over arrays?

554






how to split string in java?

643


What an i/o filter?

554


What if I write static public void instead of public static void in java?

565


Can a static block throw exception?

643


Is it possible to define a method in java class but provide it’s implementation in the code of another language like c?

566


Can you override private or static method in java?

537


What is procedure overloading?

1787


Define how does a try statement determine which catch clause should be used to handle an exception?

566


What is difference between path and classpath in java?

474


Can we write any code after throw statement?

593