When to use abstract class or interface in java?

i am new to the java, while practice i have got lot of confusion to where i have to use the abstract class and where i have to use the interface.

in interface all methods are undefind if we implements the interface we must override the all methods of interface.

coming to abstract class here it's contains some methods are defind and some methods are undefind if we extends abstract class we have to override the undefined methods only,you must know one thing if we want to extend morethan one class is not possible but we can implements the more than one interfaces at a time.depends on requirement we have to use the abstract class and interface.