Charles Paldino

Greenhorn
+ Follow
since Oct 23, 2010
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
5
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Charles Paldino

Rule of thumb: If you have to emulate another operating system to do stuff, you should probably stop using your current one.

Pat Farrell wrote:
The F9/F11 function button fails in Netbeans to compile code. I do this hundreds if not thousands of times a day. I use Netbeans and Java because they are machine independent. But they operate differently under OS-X.



Apple does its own version of java......which kind of defeats the purpose of java.

12 years ago

Henry Wong wrote:

Hansjoachim Vonhortenschiem wrote:
if intellisense is the new cool guy way of saying intelligence, then I'm afraid I'm in short supply.



Intellisense is the name of the help system for Visual Studios. And Visual Studios is not a common IDE for Java, as Microsoft is more focused on .NET.

Henry



Eclipse has practically the same thing, I can't think of the name for it, so I just call it intellisense too.
12 years ago

Hansjoachim Vonhortenschiem wrote:

Just use intellisense, or look at an object view in the IDE you are using.




if intellisense is the new cool guy way of saying intelligence, then I'm afraid I'm in short supply.

as for and IDE, I use notepad and the command prompt.

but thanks for a reason to use an IDE : )



No.
Intellisense
You might as well go rake yourself over coals, it'd be more productive than notepad + commandprompt

You should grab eclipse or netbeans, there are plenty of tutorials for creating projects on youtube for them.
12 years ago

Hansjoachim Vonhortenschiem wrote:I think I may have the answer.....

Due to constructor chaining, the final object is a superset of all parent class members, including those members declared as private. However, because private members are not inherited, those private members that are included in the superset created by the class that initiated the instance with a call to new(), will be unaccessible by this final object. That is, unless there is also in this superset some inheritable accessor method to retrieve the private members......

Sound about right ?

What would really be nice is if there were some way to see what the final object consisted of, what it could access and what it could not.

For example, if ClassC extends ClassB and ClassB extends ClassA.....



if you say, ClassC myobj = new ClassC();

what would the picture of the actual object look like ?
what, in other words, would it consist of ?



Just use intellisense, or look at an object view in the IDE you are using.

Class A
-public int n = 4;
-private int m = 5;

Class B extends Class A
-public int n = 4; //inherited
--public int y = 2;
--private int z = 3;

Class C extends Class B
public int x = 1;
-public int n = 4; //inherited From B, which inherits it from A
--public int y = 2; //inherited from B
12 years ago

Hansjoachim Vonhortenschiem wrote:

marc weber wrote:

Hansjoachim Vonhortenschiem wrote:... there is some ParentCon object that exists somewhere as a result of a call to the ChildCon constructor and this object is somehow "tied" to the ChildCon object.......? ...


The ChildCon object IS-A ParentCon object.

As your output should demonstrate, a ParentCon constructor executes (i.e., creates an object) whenever you create an instance of ChildCon. A ParentCon object is created, and then that object is extended to become a ChildCon.



Thanks for the reply... but, could someone explain how private members of the superclass are handled in a situation like this ???

Are they initialized as a result of constructor chaining initiated by a subclass constructor?
Are they part of the "end" object, even though declared as private?
If, being private means "not inheritable", then how is it I can access them ?

Basically, I need the play by play of what actually happens behind the scene....

Thanks in advance



A child class must call a constructor of its parent class. If none is called the default constructor will be called automatically.
Private members do not get inherited, but can be accessed through super methods or constructors. That is happening in your example via a constructor.
The variable itself is not a part of the child class, if you attempt to override the getVarp method you will come across compile errors trying to print out the variable.

"ChildCon child1 = new ChildCon(); "

Parent constructor gets called and all parent variables get initialized. THEN child constructor gets called and child variables get initialized.

I think this is the logical process for the code.

Child constructor//ChildCon(){ System.out.println("inside ChildCon no-arg const"); }
----Parent variables initialized //varP = 6
----Parent constructor//ParentCon(){System.out.println("inside ParentCon no-arg const");}
----Child constructor finishes rest of the code
child1.getVarp() //not overridden so it calls the parent's method
--super.getVarp() //Prints out 6

This is the logical process for the other one.
Child constructor //ChildCon(int val){super(val);}
----Parent variables initialized //varP = 6;
----Parent constructor // ParentCon(int var){varP = var;} - Sets var to 12
----Child constructor finishes
child2.getVarp() //not overridden so it calls the parent's method
---super.getVarp() //Prints out 12

12 years ago
Hey guys, I appreciate all the interest.

We filled up, I'll be posting another thread if the team decides to expand again after the beta stage is completed.
13 years ago
Hi guys, I'm heading a 3 part project thats in java.

Its currently in its beta stage and I'm looking to grab some developers to help out.

Part 1 - General purpose library.
Part 2 - Portable module package utilizing that library.
Part 3 - Main application that utilizes the library and the module package.

The foundational code is already built and the projects are working correctly with eachother.

All thats left to do is create a few more modules for the official module pack, sure up the library, increase pattern fidelity, clean up code, bug fix, and improve the main application and existing modules.

I'm looking for people new to java or that are looking to learn.
No experience is necessary, I can teach and work alongside people in need with remote access.
Experienced java developers are welcome, but you guys might get bored.
Theres currently two other people working on the project, have room for ~4 more.

Theres no pay involved (yet), but I can offer a power point presentation for your portfolio that demonstrates the project as well as serve as a professional reference.
The experience with working with a medium scale project and part of a team is in also a plus.

Its based in New Jersey, U.S. but we work remotely and we are currently using Skype, TeamViewer, Eclipse, and an SVN repository (Eclipse Plugin available)

Anyone interested can send me a PM for more details or to sign up.
13 years ago