Question: analyze the code and find the error and fix the error. package fHist; public class famHist { String name = Lawrence Magee; static String family

analyze the code and find the error and fix the error.

package fHist;


public class famHist {


String name = "Lawrence Magee";

static String family = " 1 wife, 1 daughter";

public void famRecord(String name, String obj, String family) {

this.name = name;

famHist.family = family;

}


public static void main(String[] args) {

LawrenceMagee ob = new LawrenceMagee();


System.out.println("this is your immidiate family history");

System.out.println(" Your name: " + ob.name);

System.out.println(" Family Members" + family);




}

}

 

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

The error in the provided code is that the main method is trying to create an instance of the ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!