Lambda expressions, or lambdas, allow passing around blocks of code. The full syntax look like this:
The parameter types can be omitted. When only one parameter is specified without a type, the parentheses can also be omitted. The braces and return statement can be omitted for a single statement making the short form as follows:
While I understand this shows the most abbreviated form, it begs the question of where b comes from. And using the same body as the full syntax may lead to one believing the latter is intended to be the short form of the former. It may be more straightforward to use a different body (e.g. a -> a.toUpperCase())
In the fourth example, we start with the third rule, which tells us to consider 1 + 2. Both operands are numeric, so the first rule tells us the answer is 3. Then we have 3 + "c", which uses the second rule to give us "3c". Notice all three rules are used in one line?
...
The first print statement shows that between truncates rather than rounds.
...
Notice all three rules are used in one line?
Try changing the encoding to platform default and to UTF‑16 and see what happens.
In reality, many different text editors use many different encoding settings. I think in Notepad++ you can configure the encoding to use for new files, so if you set it to the system locale's default encoding, you won't have to specify the -encoding option when calling javac.
But the easiest way to deal with all of this is to simply limit the characters you use in source files to those that can be encoded in 7-bit ASCII.
Finally, line 7 does not compile because fins is in scope and accessible only inside the instance initializer on line 3, making option D correct.
Lambda expressions with one parameter are allowed to omit the parentheses around the parameter list, making C correct.
The return statement is optional when a single statement is in the body, making option F correct.