This java string literal initializing giving error when the code to initialize is within checking if par1 has a value or not. I am not sure whether I am doing or its some other issue??
public class optionalFields {
public static void main(String args[])
{
optional_func(Optional.of(true));
}
public static void optional_func(Optional<Boolean> par1)
{
if(par1.isPresent())
String s = "test";
System.out.println(s);
}
}
