0
Classes
how is it possible to make 2nd class in this program.
10 Answers
+ 9
maybe doesn t support project but only main
program. I read somethings about inner class but i don t know if it could be good for what you want to do
+ 5
Yes, in Java you can have multiple classes in one file. Only one class can be public and its name should match the filename. The rest of the classes can be package default, or protected or private nested classes. Only one class should have a main method.
+ 5
+The class matching the filename is called constructor and is used for creating objects
+ 3
what class, what program?
+ 3
you mean having two classes in one java project?
+ 3
class A {
// class A code
}
class B {
// class B code
}
+ 1
I have basic knowledge of java.
I need to make second class in this app..I try to write code in solearn
- 1
I'm coding in sololearn and I can't create second class, what to do?
- 1
2 classes in one file?
- 2
it is impossible to import JFrame? right?