package com.example.user; public class User { private String firstName; public void setFirstName(String name) { this.firstName = name; } }
User newUser = new User(); newUser.setFirstName("John");In this example, we have created a new User object and set the first name property to 'John'. The setFirstName method is included in the 'User' package, which could be part of a larger object-oriented programming library.