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

Can u any body send the DotNet Interview questions and answers to my mail please....... mindukuru@yahoo.com

1 Answers  


Do you know what is .net standard?

0 Answers  


Difference between value type & reference types ?

0 Answers  


What is a web service in .net?

0 Answers  


where are connection strings stored?

1 Answers   Manhattan,






Explain about .net assemblies?

0 Answers  


Do you know what is the difference between an abstract class and an interface?

0 Answers  


What is the difference between asp.net & vb.net and explain architecture?

0 Answers  


How do you view the methods and members of a dll?

0 Answers  


Tell me what is a “jagged array”?

0 Answers  


Compare & contrast rich client (smart clients or windows-based) & browser-based web application

0 Answers  


How to instantiate a delegate?

0 Answers  


Categories