Results 1 to 3 of 3

Thread: How to use switch statement in java

  1. #1
    Join Date
    Dec 2011
    Posts
    61

    How to use switch statement in java

    Hi, friends I am new to Java Programming as I am beginner I have seen the best uses for this java programming and also it is simple and strong OOP. So I am very much excited to know more about this language. The first thing that I want to know from you guys is about the uses and implementation of switch statement in java, so if you have any suggestion or any ideas about the uses of switch statement and program for switch statement then please let me know.

  2. #2
    Join Date
    Mar 2010
    Posts
    145

    Re: How to use switch statement in java

    According to my information this statement is used for selecting the case for the execution of statements. This switch statement also works same as if-then and if-then-else statements these switch statement have numbers of possible execution paths. The switch works with the following primitive data Type byte, short, char, and int.

  3. #3
    Join Date
    Apr 2009
    Posts
    569

    Re: How to use switch statement in java

    The following is the syntax of switch statement

    int d=3;
    switch(d)
    {
    case 1:
    //do this statement 1;
    break;
    case 2:
    //do this statement 2;
    break;
    case 3:
    //do this statement 3;
    break;
    default:
    //do this default statement;

    }

Similar Threads

  1. Java program to use enum in switch statement.
    By MADGE25 in forum Software Development
    Replies: 5
    Last Post: 01-02-2010, 06:12 PM
  2. Need Codings for PHP Switch Statement?
    By NGV BalaKrishna in forum Software Development
    Replies: 5
    Last Post: 27-01-2010, 10:31 PM
  3. JavaScript Switch Statement
    By Chrisch in forum Software Development
    Replies: 3
    Last Post: 03-11-2009, 03:33 PM
  4. Switch Statement in PHP
    By Projectkmo in forum Software Development
    Replies: 2
    Last Post: 31-03-2009, 12:31 PM
  5. SWITCH....CASE statement in C#
    By Aadarsh in forum Software Development
    Replies: 1
    Last Post: 10-11-2008, 05:39 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,714,064,873.53872 seconds with 17 queries