Question: I keep getting the same error and have no idea how to fix it. The error is No main methods... Here is the program public

I keep getting the same error and have no idea how to fix it. The error is No main methods...

Here is the program

public class Name {

private String fname; private char mname; private String lname;

public Name(String fname,char mname,String lname) { this(fname,lname); this.mname=mname; }

public Name(String fname,String lname) { this.fname=fname; this.lname=lname; }

public String getNormalOrder() {

if(mname=='u0000')

return fname+" "+lname;

else

return fname+" "+mname+". "+lname;

}

public String getReverseOrder() {

if(mname=='u0000')

return lname+", "+fname;

else

return lname+", "+fname+" "+mname+".";

}

public String getInitials() {

if(mname=='u0000')

return fname.toUpperCase().charAt(0)+""+lname.toUpperCase().charAt(0);

else

return fname.toUpperCase().charAt(0)+""+Character.toUpperCase(mname)+""+lname.toUpperCase().charAt(0);

}

}

Step by Step Solution

3.41 Rating (151 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Answer The error No main methods typically indicates that the Java runtime environment cannot find t... 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!