Creating / Deleting a Fragment Shortcut in Eclipse

So, I used Eclipse, and I went to copy some of the imported applications that I selected. I somehow typed incorrectly, and the coolest thing happened: the snippet package was created, and the Snippet.java class was created, which looked like this:

 package snippet; public class Snippet { public static void main(String[] args) { // Selected code } } 

Does anyone know what a shortcut is for this? This seems to be a very useful feature. I tried searching on the internet but no luck.

+4
source share
1 answer

This is what happens when you copy code and paste it into Package Explorer. If you have a project selected, it will create a snippet package; if nothing is selected, it will create a new java project with the name _pasted_code_

+10
source

All Articles