top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

What do you understand by “Unit” and “()” in Scala?

+1 vote
506 views
What do you understand by “Unit” and “()” in Scala?
posted Nov 9, 2016 by Shyam

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

Unit is a subtype of scala.anyval and is nothing but Scala equivalent of Java void that provides the Scala with an abstraction of the java platform. Empty tuple i.e. () in Scala is a term that represents unit value.

answer Nov 11, 2016 by Karthick.c
...