Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot compile class with non-default constructor #2

Open
haitaoli opened this issue Feb 2, 2018 · 1 comment
Open

Cannot compile class with non-default constructor #2

haitaoli opened this issue Feb 2, 2018 · 1 comment

Comments

@haitaoli
Copy link

haitaoli commented Feb 2, 2018

If a class contains a non-default constructor, then the compiler fails with error: java.lang.AssertionError: Value of x -1. Here is the sample code that gives error:

class Main {
    Main(int i) {
    }

    public static void main(String[] args) {
        System.out.println("Hello, world!");
    }
}
@konsoletyper
Copy link
Owner

When I put public modifer to class, the error disappears. So the reason is not in non-public constructor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants