top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

What is the use of ‘???’ in Scala-based Applications?

+1 vote
357 views
What is the use of ‘???’ in Scala-based Applications?
posted Jun 28, 2016 by Satyam

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

1 Answer

+2 votes
 
Best answer

This ‘???’ three question marks is not an operator, a method in Scala. It is used to mark a method which is ‘In Progress’ that means Developer should provide implementation for that one.This method is define in scala.PreDef class as shown below:

def ??? : Nothing = throw new NotImplementedError 

If we run that method without providing implementation, then it throws ‘NotImplementedError’ error as shown below:

  scala> def add(a:Int, b:Int) : Int = ???
    add: (a: Int, b: Int)Int

    scala> add(10,20)

scala.NotImplementedError: an implementation is missing
answer Jun 28, 2016 by Shivam Kumar Pandey
...