Here is the Java code for the program:
```java
class ItemSold {
private int invoiceNumber;
private String description;
private double price;
public int getInvoiceNumber() {
return invoiceNumber;
}
public void setInvoiceNumber(int invoiceNumber) {
this.invoiceNumber = invoiceNumber;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public double getPrice() {
return price;
}
public void setPrice(double price) {
this.price = price;
}
}
class LampSold extends ItemSold {
private boolean condition;
private int age;
public boolean isCondition() {
return condition;
}
public void setCondition(boolean condition) {
this.condition = condition;
}
public int getAge() {
return age;
}
public void setAge(int age) {
this.age = age;
}
}
public class Main {
public static void main(String[] args) {
ItemSold item1 = new ItemSold();
item1.setInvoiceNumber(101);
item1.setDescription("Antique painting");
item1.setPrice(1000.0);
ItemSold item2 = new ItemSold();
item2.setInvoiceNumber(102);
item2.setDescription("Antique sculpture");
item2.setPrice(1500.0);
LampSold lamp1 = new LampSold();
lamp1.setInvoiceNumber(201);
lamp1.setDescription("Antique brass lamp");
lamp1.setPrice(500.0);
lamp1.setCondition(true);
lamp1.setAge(50);
LampSold lamp2 = new LampSold();
lamp2.setInvoiceNumber(202);
lamp2.setDescription("Antique wooden lamp");
lamp2.setPrice(800.0);
lamp2.setCondition(false);
lamp2.setAge(70);
System.out.println("Item 1:");
System.out.println("Invoice Number: " + item1.getInvoiceNumber());
System.out.println("Description: " + item1.getDescription());
System.out.println("Price: $" + item1.getPrice());
System.out.println();
System.out.println("Item 2:");
System.out.println("Invoice Number: " + item2.getInvoiceNumber());
System.out.println("Description: " + item2.getDescription());
System.out.println("Price: $" + item2.getPrice());
System.out.println();
System.out.println("Lamp 1:");
System.out.println("Invoice Number: " + lamp1.getInvoiceNumber());
System.out.println("Description: " + lamp1.getDescription());
System.out.println("Price: $" + lamp1.getPrice());
System.out.println("Condition: " + lamp1.isCondition());
System.out.println("Age: " + lamp1.getAge());
System.out.println();
System.out.println("Lamp 2:");
System.out.println("Invoice Number: " + lamp2.getInvoiceNumber());
System.out.println("Description: " + lamp2.getDescription());
System.out.println("Price: $" + lamp2.getPrice());
System.out.println("Condition: " + lamp2.isCondition());
System.out.println("Age: " + lamp2.getAge());
}
}
```
In this program, we have a base class called `ItemSold` with fields for invoice number, description, and price. The class also has getter and setter methods for each field.
We then create a subclass called `LampSold` that extends `ItemSold` and adds two additional fields for condition and age. The subclass also includes the necessary getter and setter methods for these fields.
In the main method, we create two objects of each class and demonstrate that all the methods work correctly by setting values for the fields and printing them out.
If you run this code, it will display the details of the items and lamps created.
Please note that you need to use any Java IDE or editor to compile and run the code.