Skip to content

Tag: java

@Data annotion not working to set the value in Java

I have this POJO class: I am trying to set the value of orderNbr from a different class. I am trying to update the value of orderNbr in my XML output to 89898 and I want to do it using @Data. But when I am doing fo.setOrderNbr(89898989)I am getting a compile time error as Error:(56, 132) java: incompatible ty…

Unable to create FileWriter

I am trying to create a FileWriter instance pointing to a folder were everyone has write access: And I am getting java.io.FileNotFoundException with detail message: The folder exists and if I stop in debugger and evaluate expression below it always returns true as it should: I don’t understand what is g…

Java problem inheriting interface implementation when extending a class

I am struggling to get an interface implementation to be inherited in another class: I have a generic class that requires compareTo to be implemented. The class is called GenericList and is implemented as: I have a User class that implements compareTo: I have no problem creating a GenericList of Users: If I c…

How to get java to recognize a certain group of random integers

It’s slightly hard to explain but I’m making a basic system were it would have a random chance to output something else, I have a single integer that can be different, and need java to be able to know when this said integer is going to be 580-599. I’m Completely stuck and I’m new to ja…