Email address:
Password:
SCJP/OCPJP 1.6 certification
Practice Exams and Training
SCJP Online Training » Discussions

Your answers: G Wrong?

In the JDK 7 release, you can use a String object in the expression of a switch statement.


public class Count{

public static void main(String args[]){

String s="sri";

switch(s){

case "SRI": System.out.print("SRI LANKA ");

case "Sri": System.out.print("Sri Lanka ");

case "sri": System.out.print("sri lanka ");

case "sRI": System.out.print("sRI lANKA ");

default: System.out.print("www.lanka.lk");

}

}

}



sri lanka sRI lANKA www.lanka.lk -



G -answers correct!!! no H

ExamLab © 2008 - 2024