What is the result of x+y*z and why?
Answer / Deepa Sinha
The result depends on the data types of x, y, and z. If they are integers or floats, the operation will be performed according to the usual rules of arithmetic: first multiplication (y*z), then addition (x+(y*z)). However, if x is a string, the result will be a concatenation of x, y*z as strings. This is because the '+' operator has different meanings for numeric and string types.
| Is This Answer Correct ? | 0 Yes | 0 No |
Explain if-else-if terminology?
mention the types of variables in scala? And what is the difference between them?
Explain different types of identifiers in scala?
What is Option in Scala? What are Some and None? What is Option/Some/None Design Pattern in Scala?
What is akka in scala? Explain
Explain exception handling in scala?
What is the difference between var and value?
How to define Factory methods using object keyword in Scala? What is the use of defining Factory methods in object?
What is a applicative?
What do you mean by trait in scala and when it is used?
What is anonymous (lambda) function in scala?
What is map in scala?