We are about to switch to a new forum software. Until then we have removed the registration on this forum.
It's possible (as far as I can tell, likely) that this is a bug with Processing's compiler, but I figured I'd check here before I make a bug report.
Here is the code in question (reproduced in the most general case):
` interface TestInterface { default void doSomething() {
} } `
attempting to compile this produces the error message "Found one too many { characters without a } to match it".
Putting the following code: ` package testy;
public class Test {
public static void main(String[] args) {
// TODO Auto-generated method stub
}
public interface TestInterface
{
default int returnFour()
{
return 4;
}
}
} `
in Eclipse has yielded no compile issues, so I suspect this may be a bug. I am using Processing 2.2.1, please include your version number with your answer.
(Disclaimer: I did try to use the "code" block denoted by `, but couldn't get it to work at all, at least in the preview. If some kindly mod understands why this dark magic is not working and knows how to fix it, please go ahead)
Answers
package
norenum
!I hadn't even remembered where I first read about default methods, and so forgot that they were a Java 8 thing. Thanks!
See How to format code and text
The backticks should be used only for fragments of code, not for several lines. Apparently, lot of new users click on the C button then paste the code. That's not how it must be done. You have to paste the code, select it then hit the C button. It should indent the code.