Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialSuleyman Orazgulyyev
Courses Plus Student 5,798 PointsThis pointer in C++ and Java
Hello everyone!
My question is very short, as I know in C++ and we use -> whenever we talk about pointers, and we also use this-> . So in Java it would be this . ? Is there a -> operator in Java?
2 Answers
Seth Kroger
56,413 PointsNo, there's no such thing as pointers in Java. In Java all objects are reference types, roughly like declaring a object variable with & in C++.
In Java the -> operator is used to declare lambda functions.
Rob Bridges
Full Stack JavaScript Techdegree Graduate 35,467 PointsHello,
Java does not have pointers like C++ does,
Java does use the -> syntax for lambdas, but these are two very different things.
Suleyman Orazgulyyev
Courses Plus Student 5,798 PointsThat makes me fall in love with Java :) thank you for your answer and your time :)
Suleyman Orazgulyyev
Courses Plus Student 5,798 PointsSuleyman Orazgulyyev
Courses Plus Student 5,798 PointsThank you very much! You always provide the best answer!