Auto Generate Getters and Setters in Visual Studio Code

Introduction

By installing java IDE, you can automatically generate java getter and setters.

Installation

VS code extension that creates automatically Getters and Setters is Java IDE

  1. Open java file with Visual Studio Code
  2. Download Extention: Java IDE
  3. ctrl (command) + shift + p => type: getter setter. and Enter
https://marketplace.visualstudio.com/items?itemName=YouMayCallMeV.vscode-java-saber
public class People {
    private String name;
    private int age;
    private String language;

    /**
     * @return String return the name
     */
    public String getName() {
        return name;
    }

    /**
     * @param name the name to set
     */
    public void setName(String name) {
        this.name = name;
    }

    /**
     * @return int return the age
     */
    public int getAge() {
        return age;
    }

    /**
     * @param age the age to set
     */
    public void setAge(int age) {
        this.age = age;
    }

    /**
     * @return String return the language
     */
    public String getLanguage() {
        return language;
    }

    /**
     * @param language the language to set
     */
    public void setLanguage(String language) {
        this.language = language;
    }
}

Leave a Reply

Your email address will not be published.

ANOTE.DEV