java - Having trouble creating a new object from a class in Eclipse -


Eclipse says that the following code has an error with the keyword "new" and "dog", but I copy it I have no idea what is wrong here in the book directly from the example

Eclipse Error # 1: A Variable Error # 2 Dog: Token "New" can not resolve the syntax error; Delete the token

  Package PKG; // dog class class dog {int size; String breed; String name; Zero bark () {System.out.println ("rough! Rough!"); }} // This function is testDrive Public Square Helvald {Public Static Zero Main (string [] Args) {// Problem here, both "new" and "dog" underlined dog D = new dog; D. size = 40; D.bark (); }}    

You are missing more constructor braces more specifically: / P>

  dogs d = new dog ();    

Comments

Popular posts from this blog

mysql - BLOB/TEXT column 'value' used in key specification without a key length -

c# - Using Vici cool Storage with monodroid -

python - referencing a variable in another function? -