Java is based on pass by reference or pass by value ..
Answers were Sorted based on User's Feedback
Answer / venkatesh
Java supports both Pass By Value and Pass By Reference
Pass By Value: In Java method pass value , changed value is
visible within a method, it will not effect outside of the
method
Pass By Reference: Pass Java Object in method , changed
value will be available outside of method also.
Is This Answer Correct ? | 9 Yes | 5 No |
Answer / arun
Java is actually pass-by-value for all variables running
within a single
VM. Pass-by-value means pass-by-variable-value. And that
means, pass-by-copy-of-
the-variable!
Is This Answer Correct ? | 1 Yes | 0 No |
Answer / dheeraj pareek
Java is purely based on "Pass-by-value".
Variables are passed by value, and in case of Object, object reference is passed by value.
Is This Answer Correct ? | 0 Yes | 0 No |
Answer / sanket mehta
Java does not support call by reference because in call by reference we need to pass the address and address are stored in pointers n java does not support pointers and it is because pointers breaks the security. Java is always pass-by-value. Pass by reference in java means the passing the address itself
Is This Answer Correct ? | 0 Yes | 0 No |
What is equlas() and hashcode() contract in java? Where does it used?
why abstract class will have a constructor?
If I will write String s=new String("XYZ"); String s1=new String("XYZ"); if(s.equals(s1)){ sop("True"); } else{ sop("False"); } This program will give me "True". But When I am creating my own class suppose class Employee{ public Employee(String name); } Employee e= new Employee("XYZ"); Employee e1 = neew Employee("XYZ"); if(e.equals(e1)){ sop("True"); } else{ sop("False"); } Then it will give the output as "False". Can I know what is happening internally?
Is there memory leaks in java?
What function extracts specified characters from a string?
Which class has no duplicate elements?
Is 0 true or is 1 true?
What are the types of relation?
What is java instanceof operator?
Explain about collection interface in java?
What is difference between overloading and overriding?
What is ascii format?