answersLogoWhite

0

What is pointer in java?

Updated: 8/11/2023
User Avatar

Wiki User

13y ago

Best Answer

There is no concept similar to pointers in Java. Pointers are a feature in C Programming using which a programmer can access the memory. This was the cause of major catastrophic programming bugs. The creators of Java excluded this feature just to avoid such catastrophic bugs.

User Avatar

Wiki User

12y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

12y ago

Pointer is strictly avoided in java.

because, java runs under JRE (Java runtime environment) which always have some memory allocated to it for execution of program , when we use pointer it is possible that ,this pointer variable use memory outside of JRE then this will cause an error which is undefined.

so pointer is not useful in java

-regards

jagadish patil

B.G.College

pune

This answer is:
User Avatar

User Avatar

Shelly Perry

Lvl 2
3y ago

No,Java does not support pointer. A pointer is a variable which can hold the address of another variable or object. there is no any concept for pointer in java which makes java robust.

This answer is:
User Avatar

User Avatar

Wiki User

15y ago

No. Java does not supports Pointers.

This answer is:
User Avatar

User Avatar

Wiki User

13y ago

Java does not have pointers.

This answer is:
User Avatar

User Avatar

AMAL LAUNDRY

Lvl 3
2y ago

It doesn't support for call by reference.

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is pointer in java?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What you use in case of pointer in java?

Java does not have pointers


In which language pointer concept is not used?

Java


Why do java consider pointer as dangerous?

programmers are always confused with pointers


Why java is more preferable than c plus plus?

Becuse there r no use of pointer in java. So we can't think about memory manipulation..............


Java null pointer exceptions?

A null pointer exception in java comes when you are trying to perform any action on an object that isnt initialized/has a value i.e., is a NULL Value Ex: private String s; //declare a string if(s.equals("test")){ //do something.. } You will get a null pointer in the if condition because you are checking a value that is null which is not allowed..


How we can get address of variables in Java as pointer variables in C?

At any given point of time you cann't get the address of a variables of java program. This is meant for security purpose only.


Can NullPointerException be used with ArithmaticException using throws keyword in java?

No. You cannot throw or catch Null pointer exceptions


How can you fix uncaught exception java lang Null Pointer Exception on blackberry 8300?

The best way to fix uncaught exception java lang Null Pointer Exception on a Blackberry 8300 is by doing a restart. Shut the phone off and remove the battery for a minute. Replace the battery and turn the phone back on.


How does java secures the code?

java is securejava uses the pointer internally. programer cannot use the pointer in our program explicitly. due to use of pointers information may be lostex-int *p;int a=56;int b=98;p=&a;p=&b;in above program first time pointer points the a value and in next line p points the b value, so here a information is lost


Where string is stored on Heap or Stack in java?

A String is treated as an object, meaning there is an object on the heap. Of course, the variable you define is a pointer to the object, and it is stored on the stack.A String is treated as an object, meaning there is an object on the heap. Of course, the variable you define is a pointer to the object, and it is stored on the stack.A String is treated as an object, meaning there is an object on the heap. Of course, the variable you define is a pointer to the object, and it is stored on the stack.A String is treated as an object, meaning there is an object on the heap. Of course, the variable you define is a pointer to the object, and it is stored on the stack.


What is difference between constant in c plus plus and final in java?

The final keyword can be used to modify a class, method, or variable.When used on a variable, it means that variable cannot be changed once set.When used on a method, it means that no subclasses may override that method.


Explain the importance of this keyword in java?

this is treated like a pointer to the object it's written in. It's important if you want to call a method with the object calling it as an argument, or something like that.