UrbanPro

Learn Java Training from the Best Tutors

  • Affordable fees
  • 1-1 or Group class
  • Flexible Timings
  • Verified Tutors

Search in

Can we use pointer in java?

Asked by Last Modified  

25 Answers

Learn Java

Follow 0
Answer

Please enter your answer

Software Developer, Expertise in Java/J2ee Technology.

No, we can't. Java has reference variables which contains address of objects. The reference variables are substitute to pointers in java. But, we cannot perform mathematical operations on reference variables like pointers. (ie we cannot play with memory locations in java)
Comments

There is no pointer in java.
Comments

Hello Manish :-). We can not use pointers in Java because the language designers chose not to include pointers in the language.
Comments

The term "pointer" is strongly associated with the C/C++ concept of pointers, which are variables which explicitly store memory addresses, and which can be modified arithmetically to point to any arbitrary address. In Java, pointers exist, but not as a first-class language concept. Rather, pointers only...
read more
The term "pointer" is strongly associated with the C/C++ concept of pointers, which are variables which explicitly store memory addresses, and which can be modified arithmetically to point to any arbitrary address. In Java, pointers exist, but not as a first-class language concept. Rather, pointers only exist as an implementation detail for References. The spec says: An object is a class instance or an array. The reference values (often just references) are pointers to these objects, and a special null reference, which refers to no object. It's also telling that accessing a null reference throws a NullPointerException, not a NullReferenceException. So, clearly the Java designers were at least thinking in terms of pointers when they wrote the Java language spec. (Although really it should be called a NullReferenceException; in my opinion the name of that exception leaks through the abstraction) So, the answer is that Java References are "pointer-ish", in the sense that they are implemented in terms of pointers (just like most implementations of C++ references), but Java References provide a higher-level abstraction which restricts the programmer from manipulating the actual memory address. Syntactically, a Java reference only gives you access to the members or methods of the pointed-to Object - not the memory location of the Object. So yes, pointers exist in Java, for a certain value of "exist". But it's probably not helpful to speak in terms of "pointers" when discussing Java language concepts. read less
Comments

iOS, iPhone application development, opengles trainer

Java uses something called as reference in C++. No need to use the -> / * to dereference. Just '.' is fine.
Comments

IT Professional Trainer with 15 years of experience in IT Industry

No, You can not use pointer in java.
Comments

Tutor

Java doesn't have pointer. instead of pointer, java have reference type data type like object that point to that location reserved for the object.
Comments

Industry expert and professional lecturer/trainer

No there are no pointers in Java for developers to use.
Comments

no
Comments

Maths - Physics - Computers (MPC) Thinker

Using JNI we can call c functions ( may have pointers ). Direct support for C like pointers is not available due to security flaws of pointers. In java variables are mostly reference variables i.e in theory they are pointers as they point to memory. But direct allocation of specific memory segments as...
read more
Using JNI we can call c functions ( may have pointers ). Direct support for C like pointers is not available due to security flaws of pointers. In java variables are mostly reference variables i.e in theory they are pointers as they point to memory. But direct allocation of specific memory segments as in C is not available in Java. In Java entire memory allocation and de-allocation is done by JVM read less
Comments

View 23 more Answers

Related Questions

Why do many software engineers not like Java?
Opinions on programming languages can vary, but some software engineers may express dissatisfaction with Java for reasons such as perceived verbosity, boilerplate code, and a slower pace of language evolution...
Guruprasad
0 0
5
What is use of interface in Java language?
Polymorphism is one of the key uses of inheritance. For ex, there are many implementations of List interface. Any implementation can be taken as a list object. List list = new ArrayList(), List list2 = new LinkedList etc., This goes to many levels.
Parminder
What are the benefits of attending Java coaching classes?
Today Java is the basic requirement for the software industry by learning advanced concepts in java you will have a very good job prospective's. Even if you want to learn BIg Data, testing tools ect.....
Selvi
0 0
5

Now ask question in any of the 1000+ Categories, and get Answers from Tutors and Trainers on UrbanPro.com

Ask a Question

Related Lessons

Why we need to learn Programming languages?
Language is medium for communication. If two parties like to communicate or exchange the thoughts they must know a language. Language should be understandable by both the Parties. For example A wants to...

On the Job training is always best
On the job training always provides an opportunity to learn the best industry practices. While you work on real time you would encounter many challenges that will force you to learn many new things. Class...
M

Java Training Syllabus
Learn JAVA-J2EE Syllabus Core Java - Syllabus aligned to OCA Exam - JDK 8 Object-Oriented Programming (OOPS) concepts: Programming Languages Object Oriented Programming Classes & Objects Pillars...

Overloading in JAVA
When a class contains more than one method with the same method name but different argument types, then it is called Overloading. Methods are said to be Overloaded methods. Also, know as Compile time...

Inheritance In Java
Inheritance: The process of getting properties and behaviors from one class to another class is called inheritance. Properties: Variables Behaviors: Methods The main purpose of the inheritance...
D

Deleted U.

1 0
0

Recommended Articles

Java is the most famous programming language till date. 20 years is a big time for any programming language to survive and gain strength. Java has been proved to be one of the most reliable programming languages for networked computers. source:techcentral.com Java was developed to pertain over the Internet. Over...

Read full article >

Before we start on the importance of learning JavaScript, let’s start with a short introduction on the topic. JavaScript is the most popular programming language in the world, precisely it is the language - for Computers, the Web, Servers, Smart Phone, Laptops, Mobiles, Tablets and more. And if you are a beginner or planning...

Read full article >

Java is the most commonly used popular programming language for the creation of web applications and platform today. Integrated Cloud Applications and Platform Services Oracle says, “Java developers worldwide has over 9 million and runs approximately 3 billion mobile phones”.  Right from its first implication as java 1.0...

Read full article >

Designed in a flexible and user-friendly demeanor, Java is the most commonly used programming language for the creation of web applications and platform. It allows developers to “write once, run anywhere” (WORA). It is general-purpose, a high-level programming language developed by Sun Microsystem. Initially known as an...

Read full article >

Looking for Java Training Classes?

Learn from the Best Tutors on UrbanPro

Are you a Tutor or Training Institute?

Join UrbanPro Today to find students near you
X

Looking for Java Training Classes?

The best tutors for Java Training Classes are on UrbanPro

  • Select the best Tutor
  • Book & Attend a Free Demo
  • Pay and start Learning

Learn Java Training with the Best Tutors

The best Tutors for Java Training Classes are on UrbanPro

This website uses cookies

We use cookies to improve user experience. Choose what cookies you allow us to use. You can read more about our Cookie Policy in our Privacy Policy

Accept All
Decline All

UrbanPro.com is India's largest network of most trusted tutors and institutes. Over 55 lakh students rely on UrbanPro.com, to fulfill their learning requirements across 1,000+ categories. Using UrbanPro.com, parents, and students can compare multiple Tutors and Institutes and choose the one that best suits their requirements. More than 7.5 lakh verified Tutors and Institutes are helping millions of students every day and growing their tutoring business on UrbanPro.com. Whether you are looking for a tutor to learn mathematics, a German language trainer to brush up your German language skills or an institute to upgrade your IT skills, we have got the best selection of Tutors and Training Institutes for you. Read more