[Solved] can not find error in java [closed]

If you do not have a constructor the Java compiler will create a no-arguments constructor for you. As soon as you provide a constructor which has arguments the no-argument constructor does not get created by the compiler. So if you add a no-arguments constructor to InVoice (like below) it should work. public InVoice() { } … Read more

[Solved] Undefined reference to functions in C++ [duplicate]

Try to replace short RangeCheck(short word, short min, short max); char* prntword(short word); bool read(short *data, bool check); with short RangeCheck(short word, short min, short max){return 1;} char* prntword(short word){return 0;} bool read(short *data, bool check){return 0;} and it should compile for you (however it may not work as you expect) solved Undefined reference to … Read more

[Solved] I’m writing my first ever java program and it’s not compiling for a certain reason [duplicate]

basically the compiler tells you whats wrong. It says, “class main is public, should be declared in a file named main.java”. Java has a naming rule, that a class inside a java file needs to match that file name. Example 1: Filename -> File.java inside that file: public class Main{ … does violate that rule … Read more

[Solved] Getting error C2440

You cannot use: strcpy(Student.StudentGPA, “2.4”); strcpy(Student.StudentCredits, “31”); since Student.StudentGPA and Student.StudentCredits are of type double. Use: Student.StudentGPA = 2.4; Student.StudentCredits = 31; BTW, the line strcpy(Student.StudentMajor, “TECH”); will lead to undefined behavior since Student.StudentMajor doesn’t have enough space to hold those characters and a terminating null character. Make the size of Student.StudentMajor at least 5. … Read more

[Solved] What does return “” mean? [closed]

return “”; just returns an empty string. If you put alist.get(i).getCountry() outside of the for loop it will not make sense. (I’m assuming that’s what you mean by “end the body with that.”) It depends on i, which only exists in the loop. It’s tough to see why you’re getting that error without seeing more … Read more

[Solved] C++ “expected primary-expression before ‘(’ token” error

throw LangException( builtin_classes::exception_class::create_ImportError( String::fromAscii(e.filename)-> append(String::fromAscii(“:”))-> append(String::fromInt(e.line))-> append(String::fromAscii(“:”))-> append(String::fromInt(e.col))-> append(String::fromAscii(“: syntax error: “))-> append(String::fromAscii(e.message)) ) // This closes the function call ; // You didn’t close the throw here! solved C++ “expected primary-expression before ‘(’ token” error

[Solved] Java “try without catch” and “catch without try” [closed]

You can’t put reader.close() between the try and the catch. Either put it in a finally block, or use a try-with-resources. Like, try (BufferedReader reader = new BufferedReader(new FileReader(filenameIn))) { reader.readLine(); for (int i = 0; i < personArray.length; i++) { String[] data = reader.readLine().split(“/t”); // <– should be \\t for tab. personArray[i] = new … Read more