-
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
So, it looks like you have two different problems. The above problem is because you are putting that code into your terminal. The terminal expects shell code and you are passing it java code. The syntax error means that it doesn't even know what the code is trying to say because it is the wrong kind of code. The second example in the IDE is better. The red line under predict is part of Java's checked exceptions feature. Basically, the predict function can throw some exceptions if something goes wrong and you need to either handle or ignore the exceptions. Search for "Java checked exception" and you should find some more details about how this works. You can also get suggestions from your IDE about how to deal with the exceptions |
Beta Was this translation helpful? Give feedback.
So, it looks like you have two different problems. The above problem is because you are putting that code into your terminal. The terminal expects shell code and you are passing it java code. The syntax error means that it doesn't even know what the code is trying to say because it is the wrong kind of code.
The second example in the IDE is better. The red line under predict is part of Java's checked exceptions feature. Basically, the predict function can throw some exceptions if something goes wrong and you need to either handle or ignore the exceptions. Search for "Java checked exception" and you should find some more details about how this works. You can also get suggestions from your …