Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Meaning of class file on the file system (Sybex)  RSS feed

 
Jack Kenshin
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm studying on lambda expressions, the book illustrates an example that uses `toString()` method of lambda expressions.



It explains meaning of the output as, 

This actually does mean something. Our test class is named BuiltIns ,
and it is in a package that we created named functionalinterface .
Then comes `$$` , which means that the class doesn’t exist in a class
file on the file system. It exists only in memory.


I don't understand the meaning of the last sentences. Could you express it?
 
Jeanne Boyarsky
author & internet detective
Sheriff
Posts: 37230
519
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Jack,
When you quote from a book, can you say which book it is. I recognize this sentence as one I wrote so added it for you.

As far as the text, when you create a class, you type out a .java file and compile it to a .class file. Both are actual files that exist somewhere on your filesystem. The $$ shows it is different. There is no .java class on the filesystem. Instead Java creates the class for us. That way you don't have to type out a class and can just supply the lambda expression.

Any clearer?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!