Results 1 to 2 of 2
  1. #1
    noobinoo is offline Member
    Join Date
    Mar 2010
    Posts
    10
    Rep Power
    0

    Default if else changes to switch-case?

    Is it possible to change the if else code below to switch - case?
    Java Code:
    public class test{
     public static void main(String[] args){
       int i=3;
    if (i%2==0)
    System.out.print("EVEN");
    else
    System.out.println("ODD");
     }  
    }
    Thanks alot

  2. #2
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    19

Similar Threads

  1. Replies: 1
    Last Post: 02-12-2010, 01:50 PM
  2. In Case You Want Colors!
    By angryboy in forum Forum Lobby
    Replies: 0
    Last Post: 08-29-2009, 10:06 PM
  3. [SOLVED] Making Switch Case Insensitive?
    By iPetey in forum New To Java
    Replies: 6
    Last Post: 04-09-2009, 04:46 PM
  4. Replies: 2
    Last Post: 02-23-2009, 12:34 AM
  5. Switch Case and Key Events
    By AndrewM16921 in forum New To Java
    Replies: 4
    Last Post: 01-26-2009, 11:20 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •