fork download
/* package whatever; // don't place package name! */

import java.util.function.Consumer;
import java.util.*;
import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
	private String a = "whatever";
	
	public void method()
	{
		Consumer<String> f = x -> { System.out.println(this.a + x); };
		f.accept("lolz");
	}
	
	public static void main (String[] args) throws java.lang.Exception
	{
		new Ideone().method();
	}
}
Success #stdin #stdout 0.19s 320640KB
stdin
Standard input is empty
stdout
whateverlolz