I was wondering if Java supports uniform access. For example, in C# aCircle.radius might invoke a radius():float method or directly refer to a public field depending on the definition of the class. Is anyone know if it is the same for Java.
Thanks !
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Java does not have this. You can have a field and a method with the same name (that is, they live in different name spaces) and the only way the compiler can disambiguate which you want is that method calls must have parens.