Answer the question
In order to leave comments, you need to log in
What is the difference between "call" and "call" a class member?
Good day.
I am learning Java and wondered: what is the difference between "call" and "access" a class member?
Context:
One course defines the following: A constructor in Java is a method that cannot be called, but can be called upon to initialize a class object when it is created.
Answer the question
In order to leave comments, you need to log in
Call is usually for a method, function.
Refer - usually to properties, fields to get a value.
It is not necessary to attach great importance to this terminology, it is absolutely not important and is not necessary in real work.
A constructor in Java is a method that cannot be called.
but which can be referred to to initialize the class object when it is created
Apparently this is the result of a crooked translation. In this context, it means that the constructor code will be executed when an instance of the class is created, and it cannot be called otherwise.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question