Why scala generates 2 files, Person.class and Person$.class?

0 votes
I have a Scala project with Person.class in it. When I compile it, 2 files are getting created: Person.class and Person$.class. I am not understanding why. Can someone explain?
Feb 7, 2019 in Big Data Hadoop by Kriti
91 views

1 answer to this question.

0 votes
While running Scala, Scala objects are translated to JVM constructs. An object X is translated to a class X$ with ordinary methods, ordinary inheritance etc. This is done to be able to access its public methods from Java by calling them as static methods X.someMethod().
answered Feb 7, 2019 by Omkar
• 69,030 points

Related Questions In Big Data Hadoop

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

What are SUCCESS and part-r-00000 files in Hadoop?

Yes, both the files i.e. SUCCESS and ...READ MORE

answered Apr 12, 2018 in Big Data Hadoop by nitinrawat895
• 10,950 points
5,885 views
+1 vote
2 answers
+1 vote
1 answer

Hadoop Mapreduce word count Program

Firstly you need to understand the concept ...READ MORE

answered Mar 16, 2018 in Data Analytics by nitinrawat895
• 10,950 points
6,124 views
0 votes
1 answer

hadoop.mapred vs hadoop.mapreduce?

org.apache.hadoop.mapred is the Old API  org.apache.hadoop.mapreduce is the ...READ MORE

answered Mar 16, 2018 in Data Analytics by nitinrawat895
• 10,950 points
934 views
+1 vote
11 answers

hadoop fs -put command?

put syntax: put <localSrc> <dest> copy syntax: copyF ...READ MORE

answered Dec 7, 2018 in Big Data Hadoop by Aditya
39,632 views
0 votes
5 answers

Hadoop hdfs: list all files in a directory and its subdirectories

Hi, You can try this command: hadoop fs -ls ...READ MORE

answered Aug 1, 2019 in Big Data Hadoop by Dinish
8,486 views
+1 vote
1 answer

How to read HDFS and local files with the same code in Java?

You can try something like this: ​ ...READ MORE

answered Nov 22, 2018 in Big Data Hadoop by Omkar
• 69,030 points
2,186 views