Start networking and exchanging professional insights

Register now or log in to join your professional community.

Follow

What is pointer and does java support pointer? Give reasons.

user-image
Question added by Maryam Albalushi
Date Posted: 2015/12/03
mohd waseem waseem
by mohd waseem waseem , game developer , rex info technology

Pointer  is the variable which hold the address of the another variable in memory or it points to location of the variable in memory. In Java ,pointer is deprecated because of memory leak (misusing it like stack overflow)  by overwriting the address which cause compromise your system.

Zeeshan Latif
by Zeeshan Latif , Principal Embedded Systems Engineer , BlueEast-Orient Group of Companies

Pointer is basically holds address of variable in memory.

Ali Alawieh
by Ali Alawieh , Software Engineer (Android) , CME Offshore S.A.L

A pointer is a value that points to an address in memory .

 

Like for example : int *x = fcd8; // would point to  fcd8 address in the memory.

All languages use pointers , it doesn't have to be explicit .But the main reason for languages like Java to "hide them" is to simplify the programmers life.But other reasons could be security , not just protecting programs from hackers , but from the programmer himself. Things can go horribly wrong if you mess up using pointers. You could overwrite data you shouldn't be by simply doing x[ ] =0 in C++ where *( x ) is something you shouldn't be accessing.Try reading about buffer overflow attacks.

 

Also read about passing arguments to functions as parameters or addresses, might make things more clear for you.

 

 

 

More Questions Like This

Do you need help in adding the right keywords to your CV? Let our CV writing experts help you.