#What is it called when code is written like Classname::method

10 messages · Page 1 of 1 (latest)

floral frost
#

Trying to implement JWTs into my application and I've come across syntax like this
Claims::getExpiration and I've never learned about this syntax or way of writing code. I'm curious about what it's called or what I can search on google to get a better understanding of it.

From my understanding it's just the Classname followed by the method that is being called, but I would like a better understanding of it and how I can implement code myself to work like this.

atomic canyonBOT
#

This post has been reserved for your question.

Hey @floral frost! Please use /close or the Close Post button above when you're finished. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.

TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.

final stream
#

This is called a method reference

harsh hare
final stream
#

Claims#getExpiration refers to the method getExpiration in the class Claims

harsh hare
#

it's not always Class::method, there's also instance::method

#

and they can have different meanings based on the method and the context

floral frost
#

Thank you

atomic canyonBOT
# floral frost Thank you

If you are finished with your post, please close it.
If you are not, please ignore this message.
Note that you will not be able to send further messages here after this post have been closed but you will be able to create new posts.