All pastes #983917 Raw Edit

Meins

public text v1 · immutable
·published 2008-04-13 19:13 UTC
rendered paste body
public class Abc1 {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		int a = 1;
		int b = 3;
		System.out.print( "Das Ergebnis wäre 3 und befindet sich" );
		int c = a+b;
		if(c != 3){
			System.out.print( " NICHT" );
		}
		System.out.print( " in der IF-Abfrage." );
	
		public static int surprise(int a, int b) {
			return a+b;
		}
		surprise(1, 2);
	}

}













Exception in thread "main" java.lang.Error: Unresolved compilation problems: 
	Illegal modifier for parameter surprise; only final is permitted
	Syntax error on token "(", ; expected
	Duplicate local variable a
	Syntax error on token ",", ; expected
	Duplicate local variable b
	Syntax error on token ")", ; expected
	Void methods cannot return a value
	The method surprise(int, int) is undefined for the type Abc1

	at Abc1.main(Abc1.java:17)