Why setter and getter methods

Why setter and getter methods

View Answers

November 30, 2009 at 4:54 PM

Hi Friend,

Getter and setter methods are used to retrieve and manipulate private variables in a different class. The getter methods retrieves the attribute of the same name and setter methods allows you to set the value of the attribute.

Thanks









Related Tutorials/Questions & Answers:
Why setter and getter methods - Development process
Why setter and getter methods  Every field has setter and getter methods.what is happening in this methods.  Hi Friend, Getter... in a different class. The getter methods retrieves the attribute of the same name and setter
why and where we use setter and getter methods in java, please give me one example program.....
why and where we use setter and getter methods in java, please give me one example program.....  why and where we use setter and getter methods in java, please give me one example program
Advertisements
please let me get code how to insert a data to mysql using setter and getter method by using java
please let me get code how to insert a data to mysql using setter and getter... to mysql using setter and getter method by using java pelease let me have the code in pure generic way ..all getter and setter in one class , code to insert to db
please let me get code how to insert a data to mysql using setter and getter method by using java
please let me get code how to insert a data to mysql using setter and getter... to mysql using setter and getter method by using java pelease let me have the code in pure generic way ..all getter and setter in one class , code to insert to db
why we use constructors instead of methods in java?
why we use constructors instead of methods in java?   why we use constructors instead of methods in java
Why doesn't Java allow overriding of static methods?
Why doesn't Java allow overriding of static methods?  Why doesn't Java allow overriding of static methods
Struts Login Validation. In This code setter of login page is called only one time again it doesnt call it. Why..?
Struts Login Validation. In This code setter of login page is called only one time again it doesnt call it. Why..?  **struts.xml** <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE struts PUBLIC "-//Apache Software
Java Swing Set And Get Values
and get values using setter and getter methods. This example explains you how... and their setter and getter methods and a display method which displays the short..., add1, add2, cityName, pincode and their setter and getter methods
methods
methods  PrintStream class has two formatting methods,what
methods
methods  PrintStream class has two formatting methods,what
methods
methods  PrintStream class has two formatting methods,what
Setter injection in Spring
Setter injection in Spring  What is Setter injection in Spring ?   The Spring IoC container supports setter injection, which is the preferred method of dependency injection in Spring. Setter injection uses the set
ModuleNotFoundError: No module named 'litter-getter'
ModuleNotFoundError: No module named 'litter-getter'  Hi, My... 'litter-getter' How to remove the ModuleNotFoundError: No module named 'litter-getter' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'news-getter'
ModuleNotFoundError: No module named 'news-getter'  Hi, My Python... 'news-getter' How to remove the ModuleNotFoundError: No module named 'news-getter' error? Thanks   Hi, In your python environment
ModuleNotFoundError: No module named 'Getty-Getter'
ModuleNotFoundError: No module named 'Getty-Getter'  Hi, My Python... 'Getty-Getter' How to remove the ModuleNotFoundError: No module named 'Getty-Getter' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'keepass-getter'
ModuleNotFoundError: No module named 'keepass-getter'  Hi, My... named 'keepass-getter' How to remove the ModuleNotFoundError: No module named 'keepass-getter' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'display-setter'
ModuleNotFoundError: No module named 'display-setter'  Hi, My... named 'display-setter' How to remove the ModuleNotFoundError: No module named 'display-setter' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'display-setter'
ModuleNotFoundError: No module named 'display-setter'  Hi, My... named 'display-setter' How to remove the ModuleNotFoundError: No module named 'display-setter' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'wallpaper-setter'
ModuleNotFoundError: No module named 'wallpaper-setter'  Hi, My... named 'wallpaper-setter' How to remove the ModuleNotFoundError: No module named 'wallpaper-setter' error? Thanks   Hi, In your
ModuleNotFoundError: No module named 'display-setter'
ModuleNotFoundError: No module named 'display-setter'  Hi, My... named 'display-setter' How to remove the ModuleNotFoundError: No module named 'display-setter' error? Thanks   Hi, In your python
why we use struts framework instead of springs
and extendible with Plugins like Convention Plugin REST Plugin getter/setter...why we use struts framework instead of springs  why we use struts framework instead of springs    It depends upon your application
static methods
static methods  why static methods cannot read or write the instance variables
could not find a getter for id in contact class
could not find a getter for id in contact class   could not find a getter for id in contact class
ModuleNotFoundError: No module named 'xbos-services-getter'
ModuleNotFoundError: No module named 'xbos-services-getter'  Hi...: No module named 'xbos-services-getter' How to remove the ModuleNotFoundError: No module named 'xbos-services-getter' error? Thanks   Hi
ModuleNotFoundError: No module named 'easy-module-attribute-getter'
ModuleNotFoundError: No module named 'easy-module-attribute-getter'  ...: No module named 'easy-module-attribute-getter' How to remove the ModuleNotFoundError: No module named 'easy-module-attribute-getter' error
ModuleNotFoundError: No module named 'torch-intermediate-layer-getter'
ModuleNotFoundError: No module named 'torch-intermediate-layer-getter' ...: ModuleNotFoundError: No module named 'torch-intermediate-layer-getter' How to remove the ModuleNotFoundError: No module named 'torch-intermediate-layer-getter' error
ModuleNotFoundError: No module named 'xbos-services-getter'
ModuleNotFoundError: No module named 'xbos-services-getter'  Hi...: No module named 'xbos-services-getter' How to remove the ModuleNotFoundError: No module named 'xbos-services-getter' error? Thanks   Hi
ModuleNotFoundError: No module named 'torch-intermediate-layer-getter'
ModuleNotFoundError: No module named 'torch-intermediate-layer-getter' ...: ModuleNotFoundError: No module named 'torch-intermediate-layer-getter' How to remove the ModuleNotFoundError: No module named 'torch-intermediate-layer-getter' error
ModuleNotFoundError: No module named 'xbos-services-getter'
ModuleNotFoundError: No module named 'xbos-services-getter'  Hi...: No module named 'xbos-services-getter' How to remove the ModuleNotFoundError: No module named 'xbos-services-getter' error? Thanks   Hi
hibernate pojo setter method problem
hibernate pojo setter method problem  how to pass a date type variable to a setter method in hibernate pojo class? //this is my pojo class import java.util.*; public class Employee { private String empname; private int
Agile methods
Agile methods   Why use Agile methods?   This methods focus on shorter iterations, in which the software is brought to a releasable level of quality fairly often, usually somewhere between weekly and monthly. Short
Methods of HttpServlet
Methods of HttpServlet  What are methods of HttpServlet
Why Abstract Class?
Why Abstract Class?  What is the use of Abstract Class if it has Zero Abstract methods
Why Abstract Class?
Why Abstract Class?  What is the use of Abstract Class if it has Zero Abstract methods
Why spring?
Why spring?  Why do we need to learn Spring? and where can we use it thanks
Spring Setter Injection
Basic Setter Injection Here in this example you will see another different type of injection known as setter injection which is the preferred method dependency injection in Spring. The convention of writing the setter method
Why NSMutableDictionary
Why NSMutableDictionary  Why NSMutableDictionary is used for?   NSMutableDictionary inherits from NSDictionary class, which is used to manage mutable associations of keys and values. Actually, NSMutableDictionary
Why request.getParameter(
Why request.getParameter(  Hi all, I want to to do upload file in my folder and that time i want to store date in my MySQL Database. Here...="POST"> why it happen? Anybody plz help me.. i want use it my project...plz
why this can't
why this can't  import java.util.*; class Dash{ public static void main(String args[]){ int x0=100; int[] x1=new int[3]; int[][] x2=new int[3][3]; int[][][] x3=new int[3][3][3
native methods
native methods  what is native methods in java?   A native method is a method that is implemented in a language other than Java. The Java native method is a great way to gain and merge the power of C or C++ programming
some methods not working on firefox and chrome
some methods not working on firefox and chrome  why some of javascript methods are not working on firefox and chrome? ex : createElement(). Please help me to solve this problem. adv thanx
Why this is not working...?
Why this is not working...?  import java.util.*; public class Family { int size_of_family=0; public Person[] members=new Person[size_of_family]; Person d = new Person(); public Family (int size_of_family){ members = new
<jsp:useBean> in JSP
:useBean>. Bean is a reusable component which mostly contains the setter and getter values, we also called it as mutators.ADS_TO_REPLACE_1 The <jsp
why jre in jdk
why jre in jdk  why jre in jdk
What are weak methods?
What are weak methods?  Hi, I am beginner in Data Science... methods? Try to provide me good examples or tutorials links so that I can learn the topic "What are weak methods?". Also tell me which is the good
methods in the applet - Applet
methods in the applet  import java.awt.*; import java.applet.Applet.... Question 1. Why is it that without defining the init() and the start() method... provides the Applet class with default implementation for all the applet methods
validate() and reset() methods
validate() and reset() methods   Describe validate() and reset() methods
Various methods of httpservletresponse interface
Various methods of httpservletresponse interface  What are the various methods of httpservletresponse interface
Why it called Struts?
Why it called Struts?  Why it called Struts
why the php is open source?
why the php is open source?  why the php is open source

Ads