I'm not sure why I'd want to utilize this. In this article, I've read provided an example of how to access the static yield function in Java's Thread class.
So, because yield is a reserved term in Scala, if I use yield with backticks,
Code:
Thread.`yield`()
Would disregard the Scala yield and allow me to use the yield function of the Java Thread class instead?
Thank you!
Yes, that is correct. By putting the word 'yield' in backticks, you are telling the Scala compiler to use the yield function from the Java Thread class instead of the Scala one. This allows you to access features from Java classes that might otherwise be unavailable in Scala due to name collisions. The additional resource might be helpful.