A collection of useful Java code snippets to boost your productivity in Visual Studio Code. This extension provides ready-to-use templates for common Java programming constructs, helping you write code faster and with fewer errors.
- Boilerplate Templates: Basic boilerplate templates
- Methods: Void, int, double, boolean, String, char, and long methods.
- Loops:
for,foreach,while,doWhilewith customizable placeholders. - Input & Output: Integer, long, double, float, string, char, arrays, and 2D matrices.
- Print Statements:
printandprintln, with or without quotes. - Conditional Statements:
if,if-else,if-else-if,switch.
All snippets include placeholders for quick customization and faster coding.
- Open Visual Studio Code.
- Go to Extensions (
Ctrl+Shift+X). - Search for Java Snippet Shortcuts.
- Click Install.
- Type the snippet prefix (e.g.,
javaboiler,intinput). - Press Tab or Enter to expand the snippet.
- Fill in placeholders for variables, types, and logic.
import java.util.*;
public class Practice {
public static void main(String[] args) {
}
}import java.util.*;
public class Practice {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
}
}int num = sc.nextInt();System.out.println();See the full list of snippets here
Want to improve this extension? Follow these steps:
- Fork the repository on GitHub.
- Create a new file and add your snippets.
- Submit a pull request with your changes.
Feel free to reach out for suggestions or queries:
- Creator : Jayadeep Varma
- GitHub : Jayadeep Varma