Java Error: String cannot be resolved into a type(S is uppercase) -


in code error (from eclipse) "string cannot resolved type":

package tilegame.display;      import javax.swing.jframe;      public class display {         private jframe frame;         private string title;         private int width, height;         public display() {             public display(string title, int width, int height){                 this.title = title;                 this.width = width;                 this.height = height;                 createdisplay();             }         }         public void createdisplay() {             frame = new jframe(title);             frame.setsize(width, height);             frame.setdefaultcloseoperation(jframe.exit_on_close);             }         } 

i searched "string" upercase , have java library eclipse.

do not nest constructors. try this:

package tilegame.display;  import javax.swing.jframe;  public class display {     private jframe frame;     private string title;     private int width, height;     public display() {      }     public display(string title, int width, int height){         this.title = title;         this.width = width;         this.height = height;         createdisplay();     }     public void createdisplay() {         frame = new jframe(title);         frame.setsize(width, height);         frame.setdefaultcloseoperation(jframe.exit_on_close);     } } 

Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -