Objects are passed by value or by reference ?


Java only supports pass by value. With objects, the object reference itself is passed by value and so both the original reference and parameter copy both refer to the same object.



Explore posts in the same categories: Java Interview Questions


BOOKMARK THIS : del.icio.us | Digg it | Furl | reddit |


Related Questions :

  • Short Core Java Interview Questions ?
  • 1. Primitive data types are passed by reference or pass by value ? Ans. Primitive data types are passed...
  • How many ways can an argument be passed to a subroutine?
  • An argument can be passed in two ways. They are Pass by Value and Passing by Reference. Passing by value: This...
  • What is the difference between a pointer and a reference?
  • A reference must always refer to some object and, therefore, must always be initialized; pointers do not have such restrictions. A...
  • What is Value type and refernce type in .Net?
  • Value Type : A variable of a value type always contains a value of that type. The assignment to a...
  • What is reference
  • A reference to an entity that is substituted for the reference when the XML document is parsed. It can reference...
  • What is entity reference
  • A reference to an entity that is substituted for the reference when the XML document is parsed. It can reference...
  • Is it possible to share an HttpSession between a JSP and EJB? What happens when I change a value in the HttpSession from inside an EJB?
  • You can pass the HttpSession as parameter to an EJB method, only if all objects in session are serializable.This has...
  • What are pass by reference and passby value?
  • Pass By Reference means the passing the address itself rather than passing the value. Passby Value means passing a copy...
  • What is local interface. How values will be passed?
  • An EJB can use local client view only if it is really guaranteed that other enterprise beans or clients will...
  • What is Reference type and value type ?
  • Reference Type: Reference types are allocated on the managed CLR heap, just like object types. A data type that is...

    Comments are closed.