Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Linux Archive
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 09-11-2008, 06:57 AM
Member
 
Join Date: Sep 2008
Posts: 4
ChazZeromus is on a distinguished road
I have Questions -_-
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. 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 am using NetBeans IDE and it's really awesome, just so that everyone knows.

1) What's the difference between extends and implements?

2) Package keyword.

3) When using a private/public keyword, what does it mean when it's use in defining a class itself and not just members?

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.

5) And any other common C++ confusion with java.

Thank you for reading my post. I look forward to having a good time talking to other developers here.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 09-12-2008, 08:35 AM
Eku Eku is offline
Senior Member
 
Join Date: May 2008
Location: Makati, Philippines
Posts: 228
Eku is on a distinguished road
umm ^_^ java is a much bigger world than C++ and ASM. I myslef also started my early programming days with c++ and TASM.
Here is my hint, you can start of by learning Core java. You can find all the answers to your question in the Java tutorial which can be downloaded from the sun site ^_^

I think I'll answer this question:

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.

It is because the Java Run-time Environment handles all the variables. you do not have to worry about this things ^_^ As i recall my instructor told me that in Java all the varaibles are handled by the JRE. The JRE allocates the memory used by that Variable. And if your system is finished using those variables, the JRE (Java Run-time Environment) cleans those used memory maps which is called the "garbage collection". I hope my memory remembers hte rigth words. Let wait for others to reply on your questions ^_^
__________________
Mind only knows what lies near the heart, it alone sees the depth of the soul.
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 09-12-2008, 10:30 AM
fishtoprecords's Avatar
Senior Member
 
Join Date: Jun 2008
Posts: 475
fishtoprecords is on a distinguished road
Quote:
Originally Posted by ChazZeromus View Post
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.
First, your topic/thread title is meaningless. You really should pick a meaningful title, as it will encourage folks to answer it.

One critical difference between Java and C (and assembler languages) that that you never use pointers. You can not do pointer arithmetic. There are no expresions that yield a pointer that you can do anything with.

The line:
Code:
MyObject myObj = new MyObject():
creates an instance of a MyObject() object, and the variable "myObj" is a reference to it. The reference works much like a C++ reference, and the syntax here is exactly what it is in C++. But it is illegal and illogical to do something like:
Code:
myObj++;
in Java, whereas it is fine in C++.
Bookmark Post in Technorati
Reply With Quote
  #4 (permalink)  
Old 09-13-2008, 12:30 AM
Member
 
Join Date: Sep 2008
Posts: 4
ChazZeromus is on a distinguished road
...that answers one question...
Oh yeah, on another note, is the run time environment open source?
Bookmark Post in Technorati
Reply With Quote
  #5 (permalink)  
Old 09-13-2008, 12:53 AM
fishtoprecords's Avatar
Senior Member
 
Join Date: Jun 2008
Posts: 475
fishtoprecords is on a distinguished road
what do you mean "open source"?

Java as a whole is owned by Sun Microsystems. There are pure FOSS implementations of the compiler and runtime system (JVM). And Sun is moving to make more and more of Java be open source at some level.

Sun has, in the past, said that Java is free, but they control it. They are loosening their control, slowly.

More importantly, why do you care? What part of open source is important to you?
Bookmark Post in Technorati
Reply With Quote
  #6 (permalink)  
Old 09-13-2008, 10:08 PM
Nicholas Jordan's Avatar
Senior Member
 
Join Date: Jun 2008
Location: Southwest
Posts: 783
Nicholas Jordan is on a distinguished road
no poly
Quote:
Originally Posted by ChazZeromus View Post
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.

Quote:
Originally Posted by ChazZeromus View Post
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.

Quote:
Originally Posted by ChazZeromus View Post
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.
Quote:
Originally Posted by ChazZeromus View Post
2) Package keyword.
namespaces.
Quote:
Originally Posted by ChazZeromus View Post
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.

Quote:
Originally Posted by ChazZeromus View Post
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?

Quote:
Originally Posted by ChazZeromus View Post
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?
__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
.
Cybercartography: A new theoretical construct proposed by D.R. Fraser Taylor
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
*mostly* GUI questions from a JavaNewb bshak1 New To Java 6 09-09-2008 05:38 AM
Questions About JSP? mtz1406 JavaServer Pages (JSP) and JSTL 2 08-19-2008 09:56 PM
Just a Few Questions pringle New To Java 21 01-09-2008 08:21 PM
questions Gilgamesh New To Java 3 11-28-2007 01:18 AM
3 Questions hiranya AWT / Swing 4 11-14-2007 06:57 AM


All times are GMT +3. The time now is 10:40 AM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org