title: Can anyone tell how can i put getter and setter on the below code, and what exactly getter and setter do
body: <pre><code>public class perform{
  
      public static void Main(String args[]) throws IOException 
      {
          perform obj = new perform();
          obj.run();
      }
        public void run() throws IOException 
        {
            String inputfile= "c:/file_adress";
            List&lt;String&gt; field = null;
            String delimeter = ";";
            String line="";
            BufferedReader br = new BufferedReader(new FileReader(inputfile));
            while((line=br.readLine())!=null)
            {
                field = new ArrayList&lt;String&gt;();
                field=Arrays.asList(line.split(delimeter));
                for (String object : field) {
  
                    System.out.println( "--&gt;" + object + "\n");
                }
            }
        }
        }
  </code></pre>
  
  <p>now when i try to put getter and setter on this code, by right clickin on the code and then going to source menu. it gives error -
  <strong><em>"The Operation is not applicable to the current selection. Select a field which is not declared as type variable or a type that declares such fields."</em></strong></p>
  
  <p>can anyone help me what changes i need to make to add getter and setter and why they are used.</p>