User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the Java section within the Software Development category of DaniWeb, a massive community of 426,593 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 1,678 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Java advertiser: Lunarpages Java Web Hosting
Views: 207 | Replies: 3
Reply
Join Date: May 2008
Posts: 6
Reputation: nouryn is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
nouryn nouryn is offline Offline
Newbie Poster

begginer

  #1  
Jul 22nd, 2008
I Used to be a c++ programmer and now i'm starting to learn java all by my self so i need a help in how to get starting begging with compiler and IDE tools and the basic diffrants between c++ and java
Thanks
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Jul 2008
Posts: 92
Reputation: bloody_ninja is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 1
bloody_ninja bloody_ninja is offline Offline
Junior Poster in Training

Re: begginer

  #2  
Jul 22nd, 2008
Look at the first stickied post. It is stickied there for a reason. It will provide everything you are asking , from compilers to tutorials.
Reply With Quote  
Join Date: Jun 2008
Location: WA, USA
Posts: 776
Reputation: Alex Edwards is a jewel in the rough Alex Edwards is a jewel in the rough Alex Edwards is a jewel in the rough 
Rep Power: 4
Solved Threads: 76
Alex Edwards's Avatar
Alex Edwards Alex Edwards is offline Offline
Master Poster

Re: begginer

  #3  
Jul 22nd, 2008
Originally Posted by nouryn View Post
I Used to be a c++ programmer and now i'm starting to learn java all by my self so i need a help in how to get starting begging with compiler and IDE tools and the basic diffrants between c++ and java
Thanks


Since you used to be a programmer, I'd suggest for you to get used to using IDE's such as--

NetBeans 6.1 (or higher)

--there are others (I think JUnit is one) but this is a very good one that will help you familiarize yourself with the language easily.


A Note about Java vs C++.

The biggest differences are--

Java has "reference-variables" that act as references AND pointers.

Java's Erasure types (Generics) are not as lenient as C++'s Templates.

Java has incredibly extensive libraries. Learning the syntax is easy, but learning the variety of API's can take you quite some time.

In Java, you pass by reference, not value. Also no method that returns a reference can be treated as an lvalue.

There is no misdirection operator in Java. You use the dot (. ) operator for member-access in all scenarios. For example--

// C++ style
  1.  
  2. int p[] = {1, 3, 2, 4}, size = 4;
  3.  
  4. //assuming Sort is a class and Merge is an inner class
  5. Sort::Merge *merge = new Sort::Merge; // :: member access for inner class Merge
  6.  
  7. merge->mergeSort(p, 0, size - 1); // -> misdirection for method mergeSort in inner class Merge
  8.  

// Java style
  1.  
  2. int p[] = {1, 3, 2, 4};
  3.  
  4. Sort s = new Sort(); // paranethesis always required when instantiating an object, even if
  5. // the object has no other defined Constructor
  6.  
  7. Sort.Merge merge = s.new Merge(); // pointers/references not declared differently
  8. // dot operator instead of ::
  9. // Reference-qualifier needed for inner class construct
  10. // Java only uses heap, no stack so all new objects
  11. // are declared new for references/pointers
  12.  
  13. merge.mergeSort(p, 0, p.length - 1); // . operator used for java "pointers"
  14.  

There are more differences, but these should help you get started with understanding the differences.

Oh by the way, Java's generics are a bit more restrictive than Templates. You cant use primitive types (even if they are constant integral types) for Generics. You can only use Objects.

If you have the absolute need to declare a constant pointer, or a solid reference to a particular address and still want to be able to change the value, you can use the final modifier.

Be warned that also, Java has no real const (read-only) modifier, as opposed to C/C++.
Last edited by Alex Edwards : Jul 22nd, 2008 at 3:18 am.
Reply With Quote  
Join Date: May 2008
Posts: 6
Reputation: nouryn is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
nouryn nouryn is offline Offline
Newbie Poster

Re: begginer

  #4  
Jul 22nd, 2008
Thanks alot Alex you clearified so many things to me
Thanks
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb Java Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the Java Forum

All times are GMT -4. The time now is 10:50 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC