Hello All ,
I am tryting execute .class file from commpant prompt with java 22 version.
I generated class file using IO classes and interfaces.when trying to execute my simple class having main method like below snippet .I see some error in command prompt which can be seen below.
public class PCRMDEA {
void main(String[] var1) {
System.out.println("Hello World");
}
}
Error while executing class from CMD : java --enable-preview PCRMDEA
Error: no non-private zero argument constructor found in class PCRMDEA
remove private from existing constructor or define as:
public PCRMDEA()
Note: I do not want to add public constructor in java file because i created .class drieclty from another java file.
Trying to make use of modify .class file directly as part of one of the feautres of ClassFile API given in java 22.
Please let me know if if you need more clarification from my side or what i should try to reolve error mentioned above.