Try to execute this once again, by uncommenting code in "Main" function.
It seems you commented out closed brace ("}") of "Main" function
i made it..
public class first1 {
static int sum=0;
public static void main(String[] args) { //1st piece of code is working for printing even numbers
int z= evengenerate(0,50);
System.out.println();
System.out.println("Return value of sum is: " +z);
if (z>1000)
{
System.out.println("Greater than 1000: " +z);
} else
System.out.println("Lesser than 1000: " +z);
/*for(int x=0;x<100;x++){
if(x%2==0){
System.out.print(" " +x);
}
}*/
}
public static int evengenerate(int x,int y){ //2nd piece
for(x=0;x<y;x++){
if(x%2==0){
System.out.print(" " +x);
sum=sum+x;
}
}
System.out.println(" ");
System.out.print("Total sum of all Even numbers is: " +sum);
return sum;
}
}