Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Java > Java and JDK > BOOK: Ivor Horton's Beginning Java, Java 7 Edition
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Ivor Horton's Beginning Java, Java 7 Edition
This is the forum to discuss the Wrox book Ivor Horton's Beginning Java, Java 7 Edition by Ivor Horton ; ISBN: 978-0-470-40414-0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Ivor Horton's Beginning Java, Java 7 Edition section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old December 26th, 2011, 05:49 AM
Registered User
Points: 32, Level: 1
Points: 32, Level: 1 Points: 32, Level: 1 Points: 32, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Dec 2011
Posts: 7
Thanks: 1
Thanked 0 Times in 0 Posts
Default error: qualified new of static class

Hi i tried Pg 218 example. The program failed to compile on both author's code and my own code (which are basically the same thing).

For the line:
Code:
        MagicHat.Rabbit rabbit = oldHat.new Rabbit();           // Create rabbit objects
the compiler could not compile and throws an error:

Code:
TryNestedClass.java:8: error: qualified new of static class
        MagicHat.Rabbit rabbit = oldHat.new Rabbit();           // Create rabbit
 objects
                                 ^
1 error
How do i solve this? Thanks

EDIT 1:

I solved it. I made a silly mistake of declaring my nested class as static. Moderator pls close thread thanks.

Last edited by xiao_mao_mimi; December 26th, 2011 at 05:57 AM.
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Static class arnab-jit C# 2008 aka C# 3.0 13 October 31st, 2011 03:28 AM
Using Static variables in Static Class JoinTTT BOOK: Professional ASP.NET 3.5 : in C# and VB ISBN: 978-0-470-18757-9 4 March 29th, 2009 05:08 PM
Using logging class as a static class punitw General .NET 0 August 14th, 2008 03:03 AM
static field with class instance prakash.suthar Java Basics 2 July 3rd, 2006 01:41 AM
static Class in ASP chafor ASP.NET 1.0 and 1.1 Basics 4 January 13th, 2006 09:58 AM



All times are GMT -4. The time now is 09:39 PM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
2013 John Wiley & Sons, Inc.