Java Interview Question And Answer Does Java have Pointers Interview Question And Answer

1,445 views · Published 8 December 2013 · 3:22 · Indexed 6 November 2026

Channel: Interview DOT · 2013 · Science & Technology

Watch on YouTube

Click here - https://www.youtube.com/channel/UCd0U_xlQxdZynq09knDszXA?sub_confirmation=1 to get notifications. Java Interview Question And Answer Does Java have Pointers Interview Question And Answer

No, Java does not have pointers. This was an intentional decision by the creators of Java, because most people would agree that having pointers creates a lot of potential bugs in the code -- pointers can be quite confusing, especially to new programmers. 

The two largest causes of bugs in C++ are pointers and multiple inheritance. The fact is that LOTS of developers mess these things up. Therefore these two concepts were left out of Java.

A reference is an abstract identifier for an object. It is not a pointer. A reference tags a particular object with a name in the Java virtual machine so that the programmer may refer to it.

How exactly the virtual machine implements references at the level of machine code is VM-dependent and completely hidden from the programmer in any case.

The obvious problem is that Java doesn't guarantee that an object stays at the same address throughout its lifetime.

Efficient garbage collectors rely on being able to move objects around, and doing so would invalidate any pointers that (previously) pointed to the object.

A Job Portal
http://www.InterviewDot.com http://www.InterviewDot.com http://www.InterviewDot.com
One Click Dream Job - http://www.interviewdot.com/upload-resume/uploadresume.htm

Other Top Job Portals
www.Naukri.com
www.MonsterIndia.com
www.TimesJobs.com

Are you looking for a new Job ?
InterviewDot.com - A Job Portal
http://www.InterviewDot.com http://www.InterviewDot.com http://www.InterviewDot.com
One Click Dream Job - http://www.interviewdot.com/upload-resume/uploadresume.htm

More from this channel