Question: i'm making a mini java game and i got an error while compiling:

```
error:invalid method declaration;return type requied
public init() throws Exception {
       ^

```

First version was public void init, but i can't do like that because i need to use try{..}catch(Malformed...) or while compiling i got another error (needs catch blah blah).

This is code:

```
public void run() throws Exception{
try{
this.zz();
}catch(MalformedURLException me){
throw me;
}
this.zo();
}

```

Answer: 
You forgot to add the return type. Since you're returning 0, I assume that you want to return an int. So change your header to:

```
public int init() throws MalformedURLException

```

There's no reason to have `throws Exception`. Be as specific as possible.

In general, the syntax for methods is:

**access modifier** (*public, protected, private*) **return type** (*primitive, object, void*) **method name**

Here's the Oracle tutorial on [Defining Methods](http://docs.oracle.com/javase/tutorial/java/javaOO/methods.html).

Also, not sure if this applies, but if you only plan to return solely 0 or 1, for example, consider changing your method header to:

```
public boolean init() throws MalformedURLException

```
Return type is mandatory. You have to provide one. No escape from this, I guess.