Results 1 to 4 of 4
- 03-11-2012, 03:25 PM #1
Member
- Join Date
- Mar 2012
- Location
- Melbourne
- Posts
- 2
- Rep Power
- 0
Struggling with overriding abstract classes
Hi,
I have been struggling with code - mainly because I'm both learning Java and trying to make a mod for minecraft at the same time...
I am not getting much communication from the Minecraft community, so I am trying over here. I think perhaps because so many people with zero knowledge of Java ask for others to do most of the work for them.
What I'm trying to do is - make a mod for the game Minecraft that will display visual representations of sounds - good for the Deaf and hard of hearing!
I took some code that renders text on the screen and made a subclass of an abstract class which deals with rendering - I've taken the code from another subclass of this renderer.
As far as I can see, I'm doing the same thing all the other subclasses are doing but the compiler refuses to let it work. It returns a 'renderCaption is not abstract and does not overrride abstract method doRender' error ... I've been trying to figure it out for the last few days... Going over the Java tutorials constantly, but can't figure it out.
I don't think Minecraft is open source so I won't post it's code, just my subclass's code..
I really hope someone can give me some pointers!
Here is a copy of the subclass renderCaption ;
https://gist.github.com/2014869
- 03-11-2012, 03:47 PM #2
Re: Struggling with overriding abstract classes
Why do they call it rush hour when nothing moves? - Robin Williams
- 03-12-2012, 02:44 AM #3
Member
- Join Date
- Mar 2012
- Location
- Melbourne
- Posts
- 2
- Rep Power
- 0
Re: Struggling with overriding abstract classes
Thank you, but I am actually quite familiar with that page.
It says I need to implement all the abstract methods contained in the abstract superclass into my subclass.
There appears to be only one abstract method in 'Render' and that is 'doRender'.
I've implemented it and it doesn't compile. I checked all the other subclasses, they are doing it the same way as far as I can see.
Also, theres a class constructor - with the same name as the java file for each subclass, I've put that in too.
I've imported the relevant stuff at the top...
I am finding it difficult to pinpoint what is missing.
- 03-12-2012, 10:07 AM #4
Similar Threads
-
Abstract classes
By FadedAura in forum New To JavaReplies: 4Last Post: 11-21-2011, 10:16 PM -
Overriding the abstract method
By wramhoff in forum New To JavaReplies: 2Last Post: 10-08-2011, 02:48 PM -
abstract classes
By renju krishnan in forum New To JavaReplies: 1Last Post: 09-29-2010, 08:31 AM -
anonymous (unnamed) Classes by default always folllows Overriding concept
By mahendra.athneria in forum Advanced JavaReplies: 7Last Post: 02-26-2009, 06:46 AM -
[SOLVED] Using classes and overriding one class for another
By StealthRT in forum New To JavaReplies: 3Last Post: 04-08-2008, 07:12 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks