\begin{defproblem}{code-helloworld}
This problem has a code fragment.
\begin{onlyproblem}
\lstset{language=Java}
\begin{lstlisting}
public class HelloWorld
{
  public static void main(String[] args)
  {
     System.out.println("Hello World!");
  }
}
\end{lstlisting}
\end{onlyproblem}
\begin{onlysolution}
\lstset{language=Java}
\begin{lstlisting}
public class HelloWorld
{
  public static void main(String[] args)
  {
     System.out.println("Hello "
      + (args.length==0 ? "anon" : args[0])+"!");
  }
}
\end{lstlisting}
\end{onlysolution}
\end{defproblem}
