Questions on VM's Java Behavior

Post Reply
UrbanCyborg
Posts: 599
Joined: Mon Nov 15, 2021 9:23 pm

Questions on VM's Java Behavior

Post by UrbanCyborg »

Got a couple of obscure ones. Easier one first, and I likely know the answer: can you call member functions in a class constructor? In C++ this would be a no-no, on the grounds that the object isn't an object until it's totally instantiated, but I'm not so sure about Java, because the compiler doesn't bark if you do it.

Second, and more obscure: if you create a member function that overrides an inherited class function, the super version is not called, right? So if you then call the super version from within the overridden version, they shouldn't collide. Except that they seem to. The basic problem I'm running into involves the distinction between the value of a derived control versus the value of its parent. I'm trying to maintain my own state, which I expect VM to recognize as the value of the control, and it seems to be getting it confused with the value of the parent object, which is that object's state value.

If I seem to be talking in circles, well, it feels like I'm going in them. :?

Reid
Cyberwerks Heavy Industries -- viewforum.php?f=76
User avatar
utdgrant
Posts: 540
Joined: Wed Apr 07, 2021 8:58 am
Location: Scotland
Contact:

Re: Questions on VM's Java Behavior

Post by utdgrant »

Could you post some actual code examples? It's all a bit abstract (ha!) talking about inherited classes, methods and overrides without concrete code to look at.

You don't have to post any of the contents of the methods, just the inheritance hierarchy. And change class / method names if you want to keep your development secret.

Have you tried explaining your design to a rubber duck?
______________________
Dome Music Technologies
UrbanCyborg
Posts: 599
Joined: Mon Nov 15, 2021 9:23 pm

Re: Questions on VM's Java Behavior

Post by UrbanCyborg »

I don't believe in ducking. I talk my code out with my statue of the Brain (don't have Pinky). :D Curiously, though, I was just Brain-talking before checking this thread, and spotted where the interaction occurs. But thanks, anyway.

Reid
Cyberwerks Heavy Industries -- viewforum.php?f=76
User avatar
utdgrant
Posts: 540
Joined: Wed Apr 07, 2021 8:58 am
Location: Scotland
Contact:

Re: Questions on VM's Java Behavior

Post by utdgrant »

UrbanCyborg wrote: Fri Jul 08, 2022 9:40 pm I talk my code out with my statue of the Brain (don't have Pinky).
That form of debugging could take over the world!
______________________
Dome Music Technologies
UrbanCyborg
Posts: 599
Joined: Mon Nov 15, 2021 9:23 pm

Re: Questions on VM's Java Behavior

Post by UrbanCyborg »

Are you pondering what I'm pondering...? 8-)
Cyberwerks Heavy Industries -- viewforum.php?f=76
Post Reply

Return to “Module Designer”