Re: Re: Re: C/C++ Vs Java
Quote:
Originally posted by Magos
Eh? Everything in Java (except the 'normal' datatypes, like int) are pointers.
well i agree with you..
But let me clarify.. many people think that JAVA does not have pointers and it is a disadvantage.... JAVA uses pointers internally to work.. But it does not allow he programmer to use pointers(like int *variable) etc etc... And it is in no way a disadvantage... This was done to make java more secure... For example if pointes were allowed.. then i could write an applet which would access your memory and put some harmfull code in there... And your computer can be infected by a virus if you visit a web page with an applet in it... So to avoid those problems pointers access is not given to the programmer... When an applet is run on a machine it is not allowed access to other parts of the memory and the files in the system.. The java applet will run in a secure memory space.. and it cannot access anything outside this.. This is what makes java secure.. So hope everyone understands... And java is not mean to write system level programs.. so pointers are not needed...
Re: Re: Re: Re: C/C++ Vs Java
Quote:
Originally posted by vasanth
well i agree with you..
But let me clarify.. many people think that JAVA does not have pointers and it is a disadvantage.... JAVA uses pointers internally to work.. But it does not allow he programmer to use pointers(like int *variable) etc etc... And it is in no way a disadvantage... This was done to make java more secure... For example if pointes were allowed.. then i could write an applet which would access your memory and put some harmfull code in there... And your computer can be infected by a virus if you visit a web page with an applet in it... So to avoid those problems pointers access is not given to the programmer... When an applet is run on a machine it is not allowed access to other parts of the memory and the files in the system.. The java applet will run in a secure memory space.. and it cannot access anything outside this.. This is what makes java secure.. So hope everyone understands... And java is not mean to write system level programs.. so pointers are not needed...
True! But you could still be allowed to use pointers, but only to point at data (variables) in your own program (pretty much how it works now), not to set the pointer to a specific adress in memory like you can in C.