Quizzes
Site Language: English
Українська
English
Русский
Programming Tests
Login
Sign Up
Programming Tests
Theory
Snippets
Papers
Landing
Android
Prices
FAQ
Cosmo Story
Terms and Conditions
Privacy Policy
Cookies Policy
Send Feedback
return type
:
Content language: English
Русский
Scala's Unit roughly corresponds to which Java type?
return type
Unit
return type
Unit Example
return type
Let's assume we have the following Action in PlayFramework 2.* controller: def action = Action { request => if (true) { return BadRequest("bad") } Ok("all ok") } What will be displayed as the result of requesting the action?
return type
Best practices: MUST NOT use "return"
return type
Return Expressions
return type
Return Expr and anonymous functions
return type
What will be the result of following code execution? object Main extends App { def gcd(a: Int, b: Int) = if (b == 0) a else gcd(b, a % b) println(gcd(5, 15)) }
return type
What will be the result of following code execution? object Main extends App { def quiz = { val result = 5 + 6 } println(quiz) }
return type
What is the returned type of this function: def sayHelloRunnable(name: String) = new Runnable { def sayIt() = println(s"Hello, $name") def run() = sayIt() }
return type
← Prev
1
2
Next →
Sign Up Now
or
Subscribe for future quizzes