StackOverflow Questions for Tag: switch-expression

Arvind Kumar Avinash
Arvind Kumar Avinash

Reputation: 79580

Does switch support objects other than Byte, Short, Character, Integer, enumerated types, and the String type?

Score: 7

Views: 114

Answers: 1

Read More
Arvind Kumar Avinash
Arvind Kumar Avinash

Reputation: 79580

What are switch expressions and how are they different from switch statements?

Score: 45

Views: 28544

Answers: 4

Read More
Shiva Naru
Shiva Naru

Reputation: 1215

C# 8 switch expression for void methods

Score: 59

Views: 32037

Answers: 4

Read More
acanthite
acanthite

Reputation: 163

How to tell quarkus to use java 17?

Score: 2

Views: 554

Answers: 1

Read More
huzle
huzle

Reputation: 2699

C# 8 switch expression with multiple cases with same result

Score: 268

Views: 124808

Answers: 6

Read More
Edwin
Edwin

Reputation: 462

gradle-based IntelliJ project: How do set to Java21+?

Score: 1

Views: 152

Answers: 1

Read More
JustACoder
JustACoder

Reputation: 73

Switch expression vs switch statement which one to use

Score: 1

Views: 530

Answers: 1

Read More
andriy
andriy

Reputation: 4164

Java 17: warning "switch expression does not cover all possible input values" is not shown if there is no return

Score: 8

Views: 5415

Answers: 1

Read More
quat
quat

Reputation: 206

Can a Java 21 switch expression have multiple guards?

Score: 2

Views: 2172

Answers: 3

Read More
user10829672
user10829672

Reputation: 39

using multiple statements in switch expression is giving CS0201 error

Score: -2

Views: 116

Answers: 1

Read More
Taylor Brown
Taylor Brown

Reputation: 382

Why do I need an explicit downcast in an exhaustive switch expression?

Score: 4

Views: 232

Answers: 3

Read More
Neir0
Neir0

Reputation: 13377

Combine return and switch in C#

Score: 79

Views: 186229

Answers: 15

Read More
yesman
yesman

Reputation: 7838

C# how to use enum with switch

Score: 123

Views: 342175

Answers: 11

Read More
Idalas
Idalas

Reputation: 83

Why Must Variables used in Guarded Pattern Case Labels be Final/Effectively Final? (Java 21)

Score: 2

Views: 327

Answers: 1

Read More
Mehdi Rahimi
Mehdi Rahimi

Reputation: 2566

Why was the yield keyword introduced for switch expressions? (not just use return keyword)

Score: 4

Views: 1856

Answers: 3

Read More
Imperiestro Mongo
Imperiestro Mongo

Reputation: 21

CA1508: 'null => true' is always 'true'. Remove or refactor the condition(s) to avoid dead code

Score: 2

Views: 299

Answers: 1

Read More
John Smith
John Smith

Reputation: 191

Why does C# pattern matching return float for this?

Score: 0

Views: 75

Answers: 1

Read More
Dan Stevens
Dan Stevens

Reputation: 6850

How to use a switch expression to match a value where it equals another non-constant value

Score: 0

Views: 248

Answers: 1

Read More
turbofood
turbofood

Reputation: 322

Is there a way to do switch expression fallthrough with lambda-like syntax for default case?

Score: 6

Views: 7854

Answers: 2

Read More
Kamran Pervaiz
Kamran Pervaiz

Reputation: 1931

c# 8 switch expression: No best type was found for the switch expression

Score: 29

Views: 24485

Answers: 4

Read More
PreviousPage 1Next