change to one-liner: ` public int expectedminutesinoven() { return 40; }` in csharp

To change the mentioned method to a one-liner in C#, you can use the expression-bodied syntax. Here's the modified code:

main.cs
public int ExpectedMinutesInOven() => 40;
42 chars
2 lines

By using the => arrow syntax, you can directly return the value 40 without the need for the return keyword.

related categories

gistlibby LogSnag