Mohit Arora
Mohit Arora

Reputation: 95

What is the purpose of different version of class file in "target/classes" folder when i do maven-build?

There is a java file named "CustomerDao.java" in my project. When i build my java project using maven . So in the folder "target\classes(structure of my project)", "CustomerDao$2.class",CustomerDao$1.class,CustomerDao$3.class,CustomerDao$4.class.... upto 35 , class files have created .

So what this number stands for & what is the purpose of these files . Why every time different versions of files are getting appeared ?

Upvotes: 0

Views: 895

Answers (1)

Adrian Shum
Adrian Shum

Reputation: 40036

They have nothing to do with Maven, and they are not different version of files.

They are simply anonymous inner class. Although in code, there is no name for the anonymous inner class, Java compiler is going to create a corresponding class (and hence, a class file)

Upvotes: 4

Related Questions