KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I am not able to understand why this code doesn't compile: class A { public static void main(String[] args) { System.out.println("hi"); } } private class B { int a; } I am saving the contents in a file named A.java - and I get an error: modifier private not allowed here // where I have defined class B This happens both when I try B as private and protected. Can someone please explain me the reason behind this? Thanks !
Tags (comma-separated)
Save Edits
Cancel