Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8953139
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T14:02:08+00:00 2026-06-15T14:02:08+00:00

In the 1 month experience I’ve had with any programming language, I’ve assumed that

  • 0

In the 1 month experience I’ve had with any programming language, I’ve assumed that switch case conditions would accept anything in the parenthesis as a boolean checking thingamajig, ie
these:

|| && < >

Know what I mean?

something like

char someChar = 'w';
switch (someChar) {
case ('W' ||'w'):
    System.out.println ("W or w");
}

Sadly, doesn’t seem to work that way. I can’t have boolean checking in switch case.

Is there a way around it?

By the way, terribly sorry if I’m sounding confusing. I don’t quite know the names for everything in this language yet :X
Any answers appreciated

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T14:02:09+00:00Added an answer on June 15, 2026 at 2:02 pm

    You can achieve an OR for cases like this:

    switch (someChsr) {
    case 'w':
    case 'W':
        // some code for 'w' or 'W'
        break;
    case 'x': // etc
    }
    

    Cases are like a “goto” and multiple gotos can share the same line to start execution.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Two month ago I asked, how to realize the routing with language parameter in
Does anyone have any experience positioning the jquery.datepicker found at http://www.kelvinluck.com/assets/jquery/datePicker/v2/demo/datePickerClickInput.html Functionality-wise it works
Firstly, I'm a newbie to C# and SharePoint, (less than a month's experience) so
In the last month, we've had a persistent problem with the Python 2.6.x multiprocessing
I'm new to scripting, but I have a lot of experience programming in languages
I'm fairly new to rails (only about a month's experience), so this may be
I don't have any experience with Azure and it's too expensive to move there
I've started to pick up Objective-C (with no previous programming experience) and I'm working
I'd like to work on a 2-3 month long project (full time) that involves
I'm starting to learn and practice some CoreData, with no programming experience. After searching

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.