无法编译程序显示".class expected"

-3 java

import static java.lang.Math.pow;
public class Power2
{
    public static void sampleMethod(int y)
    {
        long r=0;
        for(int i=0;i<=y;i++)
        {
            r =long(Math.pow(2,i));
            System.out.println("2*"+i+"="+r);
        }
    }
}
Run Code Online (Sandbox Code Playgroud)

Rei*_*eus 5

演员表需要括号

r = (long) Math.pow(2,i);
    ^    ^
Run Code Online (Sandbox Code Playgroud)