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

What is model-view -controller Architecture?

1 Answers  


What is difference between system.string and system.stringbuilder classes?

0 Answers  


What property do you have to set to tell the grid which page to go to when using the Pager object?

2 Answers   Siebel,


What are the new thee features of com+ services, which are not there in com (mts)?

0 Answers  


what is the use of "mustinherit" keyword?

2 Answers  


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

0 Answers  


What?s SingleCall activation mode used for?

1 Answers  


What is smart navigation?

3 Answers  


What is the difference between a debug and release build?

0 Answers  


When should I use .net core?

0 Answers  


What is func in .net 3.5?

0 Answers  


What are code contracts?

0 Answers  


Categories