MCQs > IT & Programming > Scala > If you are defining scala classes in a 'package examplepackage', and want to ensure that a function 'foo' is only accessible by classes defined in the same package, how would you declare that function?

Scala MCQs

If you are defining scala classes in a 'package examplepackage', and want to ensure that a function 'foo' is only accessible by classes defined in the same package, how would you declare that function?

Answer

Correct Answer: private[examplepackage] def foo = {...}

Explanation:

Note: This Question is unanswered, help us to find answer for this one

Scala Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it

search

Scala Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it