hts.StevenWood.com

[ Last Page ]

Common Programming Errors

  1. Defining more than one public class in the same file is a syntax error.
  2. Attempting to declare a return type for a constructor and/or attempting to return a value from a constructor is a logic error. Java allows other methods of the class to have the same name as the class and to specify return types. Such methods are not constructors and will not be called when an object of the class is instantiated.
  3. An attempt by a method which is not a member of a particular class to access a private member of that class is a syntax error.
  4. Attempting to overload a method of a class with another method that has the exact same signature (name and parameters) is a syntax error.

 

 

Source: Deitel, H.M. and Deitel P.J. Java: How to Program. 3rd ed. Upper Saddle River, New Jersey. Prentice Hall.1999. ISBN 0-13-012507-5, p 376-7. 

[Last Page]
All material on this site is copyright © 1997- by Steven Wood or as credited. All right reserved. Use of this site indicates you agreement with the  terms of use.
Send comments or questions to about this page.
Every attempt has been made to credit work under copyright. If there are any claims that copyright has been missed please contact the .
+SDG+