Discussion :: Operators and Assignments - Pointing out the correct statements (Q.No.5)
Parastandon said: (Oct 19, 2010) | |
Why [d] is not correct? |
Praveen Srivastava said: (Sep 16, 2011) | |
why [D] is not correct? why f1=f2 not true? |
Ameen said: (Jul 9, 2013) | |
@Praveen f1=f2 in java " = " is an assignment operator. " == " is used to compare in java. While speaking logically f2 creates a new reference so f1 is not equal to f2. I hope you have got it. |
Pramod Pai said: (Jul 2, 2014) | |
f1 == f3 is wrong because. After f3 = f1 statement, f1[0] is made change and equal to 42.0f, f1[0] = 42.0f, But f3[0] = 0.0f only, |
Bhargavi said: (Jul 31, 2014) | |
No pramod you are wrong. Here f1==f3. So f1 and f3 both are referring to same object i.e., float array object. If a value is changed in float array. Then also both f1 and f3 are referring same object know so both are equal. |
Aishu said: (Aug 5, 2019) | |
Why option 1 is wrong? Please explain. |
Priyanka said: (Apr 28, 2020) | |
f1 and f2 both are different objects which is stored in the heap area. So the address of both objects will be different. That's why they are not equal. |
Post your comments here:
Name *:
Email : (optional)
» Your comments will be displayed only after manual approval.