A method is a UML Class Diagram specific representation of a function called on the Object for which it is associated with.

Example

class Car {
+ fuel: int
+ drive(): void
}

A Car Class representing a drivable car.

This is an example of a Class with an attribute and a method.