Wrox Programmer Forums
|
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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 26th, 2011, 06:49 AM
Registered User
 
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 06:57 AM..





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 10:58 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.