It depends. I've gotten some use out of it recently but I have found I have to give it prompts more akin to pseudo code.
I'm not a developer, let alone a java developer, but actually got some mileage with chatgpt writing a ghidra script today. So I wrote down specifically on a notpad with pencil/paper and identified the inputs and outputs I thought of need and different methods and what not. I then started passing it prompts and got some working java back.
For me, this was useful because I almost never program in Java, and so simple things like declaring a string with `String foo` I would normally have to go look up again.
Of course, it wouldn't be useful or able to do what I wanted if I didn't already u derstand programing concepts and what not.