Originally Posted by
ChazZeromus
Hi, I'm new to the java programming language and I'd really like to learn all its facilities as fast as I can. I am right now, to my perspective, a very experienced non-virtual platform programmer. Of course my main languages are C++ and ASM and I would like to integrate the java runtime environment into my operating system that I'm designing.
The main thing to grasp first is that something along the lines of stack pointer checking is built into Java from the get-go. A runaway pointer will be trapped and thus one may do prototyping in Java as though running in a sandbox or dedicated prototyping tool. Java as well has Threads built into the api, though there is some deep discussion available for those who wish to do real cs.
Originally Posted by
ChazZeromus
And I understand classes in C++ and it's polymorphic implementation. So since I already know that, I realize some java limitations and facilities and would like to know some things that need to be cleared.
I see a lot of very deep insight from pros on this poly thing, but I prefer digging through the code rather than reliance on rtti - which we do not have vftable dispatching at runtime, we do have a sophisticated typing system which will back-climb the typing at compile time with remarkable adroitness. You may be able to provide suggestions on how to find the closest common ancestor in a typing dependency where two types that rely on the notion of a class to do typing find nearest common ancestor at compile time.
That won't do much for your code studies, but it will identifiy where java differs from cpp.
Originally Posted by
ChazZeromus
1) What's the difference between extends and implements?
implements defines methods ( functions in cpp ) that a class promises to provide a code body for.
extends gets into java's reliance on classname for typing - java is a strongly typed language. No void anything anywhere and no unsigned numerics: Even bytes are signed, which makes for need of special class BigInteger to do some operations.
Originally Posted by
ChazZeromus
2) Package keyword.
namespaces.
Originally Posted by
ChazZeromus
3) When using a private/public keyword, what does it mean when it's use in defining a class itself and not just members?
File scope issue: One public class per file, all other classes in a compilation unit are default access. Keyword is default is not coded, it is implied and is used in discussions of scope.
Originally Posted by
ChazZeromus
4) When exactly when you would use the new keyword? I know that in C++ new is allocates memory so that a pointer can point to the new memory, but I notice that java does not have any pointer facilitation. I already have hypothesis's as to why, but I want a concise answer.
How deep do you want the observation?
Originally Posted by
ChazZeromus
5) And any other common C++ confusion with java.
Google Cay S. Horstmann, note that Java has a remarkable Lib's far exceeding STL - What is your design challenge?