What is the main use of get() in java? | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
+ 1

What is the main use of get() in java?

When to use it can anybody ans?

23rd Aug 2019, 2:50 PM
AasthašŸ‡®šŸ‡³
AasthašŸ‡®šŸ‡³ - avatar
2 Respostas
+ 1
the get() function is normally called a ā€œgetterā€, and is used to get reference pointers to some data or field. Getters have many context, the get() method in a list for example, is used to get the reference of an object at a certain index. A getStudent() method in a class would represent a method to get the ā€œStudentā€.
23rd Aug 2019, 9:05 PM
Andy Wong
Andy Wong - avatar