package edu.rice.hj.example.comp322.labs.lab1; import edu.rice.hj.api.HjRunnable; import static edu.rice.hj.Module1.*; /** *

HelloWorldError class.

* * @author Shams Imam (shams@rice.edu) */ public class HelloWorldError { /** * Constant s="HelloWorld" */ public static final String s = "HelloWorld"; /** *

main.

* * @param args an array of {@link String} objects. */ public static void main(final String[] args) { launchHabaneroApp(() -> { finish(() -> { // HjRunnable is a functional interface. // It has one unimplemented method: void run() // The statement below is using lambda expressions to create an instance of HjRunnable // Note we are avoiding the verbose syntax to create anonymous inner classes with lambdas. final HjRunnable aRunnable = () -> { System.out.println("First: " + s); }; // We pass async an instance of HjRunnable to run asynchronously asyncNb(aRunnable); // Instead we can also directly inline the lambda expression into the async call. asyncNb(() -> { // TODO: Fix the error by changing 'ss' to 's' to gt rid of the compiler error System.out.println("Second: " + s); }); }); }); } }