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 |
Which is better scala or python?
How do we implement loops functionally? What is the difference between OOP and FP style loops?
Explain any five string methods?
What is the use of 'object' keyword in Scala? How to create Singleton objects in Scala?
What are higher-order functions in scala?
What is Extractor in Scala? What is the difference between Constructor and Extractor in Scala? What is the use of Extractor in Scala?
mention the types of variables in scala? And what is the difference between them?
What is the difference between Case Object and Object(Normal Object)?
What is file handling in scala?
What do you mean by scala map?
Is scala better than python?
What are the major differences between Scala’s Auxiliary constructors and Java’s constructors?