What is an attribute in Java?

Attribute is another name for a field in Java.

In this Person class, firstName and lastName are attributes:

class Person {

  String firstName; // a field or an attribute
  String lastName;  // a field or an attribute
}