Give an example for setter/ write-only methods

Answer Posted / hrindows@gmail.com

// A write-only class in Java
public class Student{
//private data member
private String institute;
//setter method for institute
public void setInstitute (String institute)
{ this.institute=institute;
}
}

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain the top .net class that everything is derived from?

557


What is the difference between a debug and release build?

589


What is different between webusercontrol and in webcustomcontrol?

541


What are the different types of remote object creation mode in .net?

575


Why do we use msmq?

603






Write the .net syntax for 'for loop'?

569


How do you trigger the paint event in system.drawing?

529


Sql Queries: A Table will be given Omiting Duplicate rows and adding a new column

1935


Do I have any control over the garbage collection algorithm?

556


When should I use .net core?

558


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

524


What is the use com component in .net?

580


Explain about .net assemblies?

612


Explain Different kinds of methods?

1636


Tell us the differences between an interface and an abstract class in .net?

562