I am new to scala and trying to understand scala oops concepts. I have create a class as :
class MyComp private{
// some fields and method goes here
}
when I compile it as
scalac MyComp.scala
It create a private constructor . but when I make a companion object than constructor becomes public , I am not able to understand this concept. Please clearify
here is the code for companion object for MyComp class
object MyComp
{
private val comp= new MyComp;
def getInstance= comp;
}