Last active
December 23, 2015 07:18
-
-
Save emres/6599431 to your computer and use it in GitHub Desktop.
A very short example to demonstrate that GWT SDK 2.5.1 still does not support Java 7 constructs, such as switch statements for String values: even though the file compiles fine, it gives error during run-time.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.manning.gwtia.ch02.client; | |
import com.google.gwt.core.client.EntryPoint; | |
import com.google.gwt.user.client.ui.Label; | |
import com.google.gwt.user.client.ui.RootPanel; | |
public class HelloWorld implements EntryPoint { | |
@Override | |
public void onModuleLoad() { | |
Label theGreeting = new Label("Hello World!"); | |
RootPanel.get().add(theGreeting); | |
String myString = "hello"; | |
switch(myString) { | |
case "hello": | |
System.out.println("hello"); | |
break; | |
default: | |
System.out.println("default"); | |
break; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment