Create a free account on Computer Sir Ki Class and unlock access to valuable learning resources.
Exam Paper Downloads: After registering and logging in, you can download exam question papers in PDF format to practice and prepare for your exams.
Student Support: Get assistance with your doubts, queries, and questions related to your studies. Our support is here to help you understand topics and resolve your learning difficulties.
Register today and make your exam preparation easier and more effective!
(i) 0 (ii) value stored in arr[0] (iii) 0000 (iv) garbage value
(ii) Name the keyword which is used to resolve the conflict between method parameter and instance variables/fields
Answer:
(i) The output would be a garbage value.
(ii) this keyword.
Notes:
(i)
When we try to output an object reference using System.out.println(), it actually prints a value using certain predefined rules. What it prints is in two parts separated by @. First part indicates the type of data and second part is hexadecimal representation of hashcode of object.
class Test { int a=10; void try(int a) { System.out.println(a); //This will print value passed to try method System.out.println(this.a); //This will print 10 the class/instance variable } }
C. Sir| Created: 5-Apr-2018 | Updated: 21-Apr-2026|ICSE2015