Skip to content

Instantly share code, notes, and snippets.

@emres
Last active December 23, 2015 07:18
Show Gist options
  • Save emres/6599431 to your computer and use it in GitHub Desktop.
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.
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