In other IDEs, I can type a method as if it existed, hit a key combination and the method is generated.
For example, I type:
public List<String> getIds() {
int max = 4;
return generateRandomArray(max);
}
As of now, the method generateRandomArray
doesn't exist.
I then hit a key combination and it generates:
private List<String> generateRandomArray(int max) {
return null;
}
How do I accomplish this in Netbeans without having to type the method manually?
Press alt+enter to show the auto fix options. Then, select create method ... (which should be the only option in most cases).