0

In my project I have many classes with many subclasses inside it, so I wanted to split them in multiple .java files like other projects that I've seen For example the miglayout open source project, there are a class named MigPane.java, and it look like it's splitted on multiple files (MigPane$subClassName.java, MigPane$subClassName2.java).

How to do like that please ?. Sorry for my bad english. Thank you.

3
  • There is no such thing. You mean .class files, not .java files. MigPane$subClassName2.java means the class inside would have to be named MigPane$subClassName2. Commented Mar 27, 2013 at 18:24
  • You Can transfer all data in Class file into a text file and then split it. Commented Mar 27, 2013 at 18:26
  • If you have .java files that contain inner classes, the compiler will automatically create multiple files when you compile your code. Commented Mar 27, 2013 at 18:28

2 Answers 2

1

When you see class files, such as MigPane$subClassName.class it is a result of MigPane containing an inner class named subClassName. The compiler automatically compiles such a class from one source named MigPane.java to two separate files.

Sign up to request clarification or add additional context in comments.

Comments

0

No you can't do it. These multiple files that you are seeing in your directory or project ( like MigPane$subClassName.class) are basically the inner classes (e.g. subClassName) defined within the MigPane.java class. These nested classes are somehow linked with the enclosed classes , So you can't segregate them.

1 Comment

@Sajjad-I have put the comment in your that question.. Have a look at that.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.