Make some adjustments:
Person p1 = new Person(cousebookname);
Pass the variable name only.
public Person(String name)
{
courseName = name;
}
Make the constructor public.
solved How to pass parameter to constructor [closed]