If you happened to be working with a command-line Java program, your main method is static. However, this is a reference to the current instance, which you can't reference from a static context. Likely what you need to do is create an instance of your object in your main method.
If you share all the code it will be easier to help. Matt Liotta President & CEO Montara Software, Inc. http://www.montarasoftware.com/ 888-408-0900 x901 > -----Original Message----- > From: Mark A. Kruger - CFG [mailto:[EMAIL PROTECTED]] > Sent: Monday, January 06, 2003 9:29 PM > To: CF-Talk > Subject: OT: Java compile error > > Ok - I'm working my way through some Java examples and I can't get this > one > to compile - can someone tell me why? I get this error: > > > > ----------------------------------first > error------------------------------------------------ > non-static variable this cannot be referenced from a static context > staff[0] = new Employee("tom", 40000); > ^ > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

