CoolInterview.com - World's Largest Collection of Interview Questions
Send Free SMS
 Interview Questions  
 Our Services  


INTERVIEW QUESTIONS J2EE JAVA DETAILS
Question :
Why pointers are not used in java?

Posted by: tamil on 5/19/2008

Contact tamil  Contact tamil
Category Java Interview Questions
Rating (3.8) By 4 users
Added on 5/19/2008
Views 1329
Rate it!
Answers:

The Java Language the referencing and dereferencing of objects is handled for you automatically. Java does not allow you to manipulate pointers or memory addresses of any kind. It does not allow you to cast object or array references into integers and It does not allow you to do pointer arithmetic. It does not allow you to compute the size in bytes of any primitive type or object. There are two reasons for these restrictions:

Pointers are a notorious source of bugs. Eliminating them simplifies the language and eliminates many potential bugs. Pointers and pointer arithmetic could be used to sidestep Java's run-time checks and security mechanisms. Removing pointers allows Java to provide the security guarantees that it does.

To a C programmer, the lack of pointers and pointer arithmetic may seem an odious restriction in Java. But once you get used to the Java object-oriented programming model, it no longer seems like a serious restriction at all. The lack of pointers does mean that you probably can't do things like write UNIX device drivers in Java (at least not without using native methods written in C). But big deal--most of us never have to do this kind of low-level programming anyway.



 Posted by: Subhabrata    

Contact Subhabrata  Contact Subhabrata

Pointers are a notorious source of bugs. Eliminating them simplifies the language and eliminates many bugs. Removing pointers allows Java to provide the security guarantees that it does.



 Posted by: santhi    

Contact santhi  Contact santhi

Pointers are not used in java,why because java is a platform independent language and also it is a one type of internet based language.



 Posted by: G.PrudhviKrishna    

Contact G.PrudhviKrishna  Contact G.PrudhviKrishna

1.To avoid confusion for the programmer.
2.Security purpose



 Posted by: Rajshekhar    

Contact Rajshekhar  Contact Rajshekhar

Pointers is eliminated in java because pointers concept are complecated for the programmer.pointers are not secure,it generates virus.



 Posted by: Manoranjan Sethy    

Contact Manoranjan Sethy  Contact Manoranjan Sethy


If you have the better answer, then send it to us. We will display your answer after the approval.
Name :*
Email Id :*
Answer :*
Verification Code Code Image - Please contact webmaster if you have problems seeing this image code Not readable? Load New Code
Process Verification  Enter the above shown code:*
Inform me about updated answers to this question

   
Related Questions
View Answer
What is super class of an Exception class?
View Answer
What is super class of an Exception class?
View Answer
Why JAVA not support multiple inheritance? How can we pass address of an object?
View Answer
In How many ways we can request the System for the garbage collection to cleanup the memory? And what are the differences?
View Answer
Why java is not pure object oriented language?
View Answer
what is the definition of arraylist? plz write in brief.
View Answer
1)What are the actual functions of JVM?
2)When to use a class and when to use
an Abstract class?
3)what is the use of constructors other than creation of objects?
4)when to use constructors?
5)when to use Interface?
6)why java does not support pointers?
7)why multiple inheritance is not possible in java without using Interfaces?
View Answer
Why we have used to in main method in JAVA this words
1)public
2)static
3)void
4)main
5)(String args[])
View Answer
Addition of two numbers using Bitwise operators.
Reading An 2D array using single for loop
View Answer
What is UML patterns?give me clear explanation
View Answer

Please Note: We keep on updating better answers to this site. Subscribe to our newsletter to get notified when better answer is posted.

Notify me when better answer is posted!
Email:

View ALL Java Interview Questions

User Options
Sponsored Links


Copyright ©2003-2010 CoolInterview.com, All Rights Reserved.
Privacy Policy | Terms and Conditions
Page URL: http://www.coolinterview.com/interview/12857/default.asp?cachecommand=bypass


Download Yahoo Messenger | Placement Papers| FREE SMS | ASP .Net Tutorial | Web Hosting | Free SMS | Dedicated Servers | Joke of the Day

0.72