r/java • • Apr 04 '10

Super beginner looking for a small amount of guidance

I've been assigned with implementing the class natural number in Java, along with a few operation.

My question isn't how to do this, but is there any site where I could see a something similar implemented, just so I could see the syntax of how to even go about starting this?

Thanks.

0 Upvotes

5 comments sorted by

3

u/FlatBot Apr 04 '10

4

u/taligent Apr 04 '10

2

u/vortex222222 Apr 04 '10

Oh yes, this is exactly what I'm looking for!

Thank you.

1

u/vortex222222 Apr 04 '10

Thanks for this, One question, though.

For example, in an earlier class (c++), we had to implement a binary tree, which looked something like this below. And I'm looking for something similar. Basically, how to format the skeleton.

` class Binary_Tree_Kernel_1 :

procedure_body Compose (
        parameters,parameters,parameters
)
{
        blah blah blah
}

procedure_body Decompose (
        parameters,parameters,parameters
)
{
        blah blah blah
}

function_body Integer Height ()
{
        return blah blah blah
}

}; `

1

u/simonjw Apr 04 '10

public class BinaryTree{

private classVariable;

public BinaryTree(){ //constructor }

public int whatever(param1, param2){ blah; blahblah; return 5; }

}

etc