Author name: admin

Which of the following is a valid variable name in Python?

Which of the following is a valid variable name in Python? a) 1variable b) variable_name c) variable-name d) @variable Answer: b) variable_name Explanation: In Python, variable names must follow certain rules. They must start with a letter (a-z, A-Z) or an underscore (_), followed by letters, numbers, or underscores. They cannot start with a number,

Which of the following is a valid variable name in Python? Read More »

What is a key advantage of using lambda expressions in Java?

What is a key advantage of using lambda expressions in Java? a) Improved performance b) Simplified syntax and more readable code c) Better compatibility with older versions of Java d) Enhanced security Answer: b) Simplified syntax and more readable code Explanation: A key advantage of using lambda expressions in Java is the simplified syntax and

What is a key advantage of using lambda expressions in Java? Read More »

Can lambda expressions be used with custom functional interfaces?

Can lambda expressions be used with custom functional interfaces? a) No, lambda expressions can only be used with built-in functional interfaces b) Yes, but only with interfaces that extend built-in ones c) Yes, they can be used with any functional interface d) No, lambda expressions are limited to standard library interfaces Answer: c) Yes, they

Can lambda expressions be used with custom functional interfaces? Read More »

Scroll to Top