Give an example program for Getter /read-only methods in JAVA



Give an example program for Getter /read-only methods in JAVA..

Answer / hrindows@gmail.com

Read-only:
//A Read-only class in Java
public class Student{
//private data member
private String institute ="MKG";
//getter method for institute
public String getInstitute (){
return institute;
}
}

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Dot Net General Interview Questions

Explain what is the difference between a class and an object, and how do these terms relate to each other?

0 Answers  


When would you use .NET Remoting and when Web services?

1 Answers   Rolta,


Please explain what is the difference between constants and read-only variables?

0 Answers  


How will u load dynamic assembly? How will create assemblies at run time?

1 Answers  


What is a design pattern and what is it for?

0 Answers  


What?s Singleton activation mode?

1 Answers  


Why is .net used?

0 Answers  


What are three common acronyms used in .net, and what do they stand for?

0 Answers  


Explain how viewstate is being formed and how it's stored on client in .net?

0 Answers  


What are the two kinds of properties.

2 Answers   Wipro,


What are an object and a class?

0 Answers  


Is atl redundant in the .net world?

0 Answers  


Categories