java - Illegal combination of modifiers: public and private -


i having issue following code...

/**  * class holds of information pertaining   * person's name.  */ public class name {      private string first, middle, last, maiden, initials, prefix, suffix;     private char middleinitial, firstinitial, lastinitial;     private      /**      * constructor name given first, middle, , last names.     */     public name(string first, string middle, string last) {          this.first = first;         this.middle = middle;         this.last = last;         this.middleinitial = middle.charat(0);         this.firstinitial = first.charat(0);         this.lastinitial = last.charat(0);         this.initials = string.valueof(firstinitial + middleinitial              + lastinitial);         this.maiden = null;         this.prefix = null;         this.suffix = null;      } 

there more error coming in primary constructor. giving me error have entered in title. can see, both class , constructor both public. shouldn't cause issues seems doing so.

you have "orphan" private modifier before constructor's comment:

private // here!  /**  * constructor name given first, middle, , last names.  */ public name(string first, string middle, string last) { 

just remove it, , should fine.


Comments

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -