Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / June 2007

Tip: Looking for answers? Try searching our database.

Starting java with C++ background

Thread view: 
Afshin - 11 Jun 2007 10:42 GMT
Hello everybody

I have some years of experience with C++ and now need to learn java. I
appreciate if you could advise me on how to get started. In the past,
I used to work with Visual C++ 5.0 and 6.0 and have recently switched
to Visual Studio 2005. I see there is a Visual J# available out there.
Is it the right place to start?

Many thanks for any comments.

Afshin
Lew - 11 Jun 2007 11:31 GMT
> Hello everybody
>
[quoted text clipped - 3 lines]
> to Visual Studio 2005. I see there is a Visual J# available out there.
> Is it the right place to start?

No, because "J#" is not Java.

Start at
<http://java.sun.com/>
and read the tutorials
<http://java.sun.com/developer/onlineTraining/>
in particular
<http://java.sun.com/docs/books/tutorial/index.html>

That last page has a link entitled "The Really Big Index" that's worth
following after that.

Signature

Lew

Ian Wilson - 11 Jun 2007 12:21 GMT
> Hello everybody
>
[quoted text clipped - 3 lines]
> to Visual Studio 2005. I see there is a Visual J# available out there.
> Is it the right place to start?

This question is frequently asked, I suggest you use Google Groups to
search comp.lang.java.* for previous discussion of this.

A brief and incomplete recap:

AFAIK VS2005 is an IDE, IDEs for Java include

Eclipse. http://www.eclipse.org. Open-Source. Free download.
Netbeans. http://www.netbeans.org. Open-source. Free download.
JBuilder. http://www.codegear.com/products/jbuilder. Commercial.
... many others

I use Eclipse.
Netbeans includes a visual GUI editor called Matisse.

Good tutorials are available at http://java.sun.com/docs/books/tutorial/

Java comes in several editions, start with the standard edition. The
other editions are for mobile devices and for enterprise applications
(e.g. web-services, JSP etc)

Most people advise you to start with console applications (non-GUI) and
only progress to GUI once you've mastered the initial problems people
have with classpaths etc.

Java has several GUI toolkits. For example AWT, Swing and SWT. I suggest
you try Swing first. Learn about pluggable "Look and Feel". Learn how to
use Layout Managers. Find out about third party GUI libraries like JGoodies.

Converting from language A to B is usually hindered by the fact that
paradigms in A cannot be directly translated to B, You have to unleard
A's paradigms first and then learn B's paradigms.
  Interfaces not Multiple Inheritance.
  References not pointer arithmetic.
  ...

I'd buy some good books. I like books by O'Reilly, e.g. "Learning Java".
There's a downloadable book "Thinking in Java" by Bruce Eckel, often
recommended.
Patricia Shanahan - 13 Jun 2007 12:23 GMT
...
> Converting from language A to B is usually hindered by the fact that
> paradigms in A cannot be directly translated to B, You have to unleard
> A's paradigms first and then learn B's paradigms.
>   Interfaces not Multiple Inheritance.
>   References not pointer arithmetic.
...

I think this effect may be why I've always been disappointed when I've
used a "conversion" book that tries to teach language B in terms of
language A.

I do better with a book that just teaches the language I want to learn.

Patricia
rossum - 11 Jun 2007 13:44 GMT
>Hello everybody
>
[quoted text clipped - 7 lines]
>
>Afshin
J# is not Java, and not well supported by Microsoft - it is only there
as a migration from Microsoft's J++ (now withdrawn) to C#.  It is
basically a J++ syntax front end for the .Net Virtual Machine.  J++
worked to the Java Virtual Machine.

If you want a Visual Java style IDE then try JBuilder from Borland.
The basic edition is free.

rossum
Mike  Schilling - 12 Jun 2007 00:01 GMT
>>Hello everybody
>>
[quoted text clipped - 8 lines]
>>Afshin
> J# is not Java,

True.

> and not well supported by Microsoft - it is only there
> as a migration from Microsoft's J++ (now withdrawn) to C#.

False.  J# is a language in its own right (neither Java now C#, though its
syntax is Java-like).  Nowadays, the .NET framework comes with J# support
(it used to be an add-on) and the .NET online documentation includes J#
examples; that is, J# support is improving as time goes on.

But the important point here is your first one: J# is not Java.
Arne Vajhøj - 12 Jun 2007 01:29 GMT
Mike Schilling wrote:
>>> I have some years of experience with C++ and now need to learn java. I
>>> appreciate if you could advise me on how to get started. In the past,
[quoted text clipped - 8 lines]
>
> True.

That depends on the definition of Java.

It is a pretty good implementation of the Java 1.1
language.

The runtime environment is not Java as it runs with .NET and not
with a JVM.

>> and not well supported by Microsoft - it is only there
>> as a migration from Microsoft's J++ (now withdrawn) to C#.
[quoted text clipped - 3 lines]
> (it used to be an add-on) and the .NET online documentation includes J#
> examples; that is, J# support is improving as time goes on.

It is not quite obvious to me that "it is only there as a migration"
and "a language in its own right" exclude each other.

J# is a separate package in both .NET 1.1 and 2.0, 3.0 is not a full
.NET at all and 3.5 is still in beta.

Arne
David Segall - 12 Jun 2007 14:36 GMT
>If you want a Visual Java style IDE then try JBuilder from Borland.
>The basic edition is free.
This is true but misleading! Codegear (formerly Borland) have released
a new edition of JBuilder <http://www.codegear.com/products/jbuilder>
and it is now based on Eclipse <www.eclipse.org> which is free but not
from Codegear. The old, free JBuilder Foundation Edition is no longer
available.
Arne Vajhøj - 13 Jun 2007 03:46 GMT
>> If you want a Visual Java style IDE then try JBuilder from Borland.
>> The basic edition is free.
[quoted text clipped - 3 lines]
> from Codegear. The old, free JBuilder Foundation Edition is no longer
> available.

There are still a free version of JBuilder - it is just called
Turbo JBuilder for 2007.

Arne
David Segall - 13 Jun 2007 15:56 GMT
>>> If you want a Visual Java style IDE then try JBuilder from Borland.
>>> The basic edition is free.
[quoted text clipped - 6 lines]
>There are still a free version of JBuilder - it is just called
>Turbo JBuilder for 2007.
Thanks Arne. I have updated my web page accordingly. I will add some
more information when Codegear include the product in their feature
matrix.
David Segall - 12 Jun 2007 14:38 GMT
>Hello everybody
>
[quoted text clipped - 7 lines]
>
>Afshin
David Segall - 12 Jun 2007 15:01 GMT
>Hello everybody
>
[quoted text clipped - 3 lines]
>to Visual Studio 2005. I see there is a Visual J# available out there.
>Is it the right place to start?
If you are looking for a Java IDE then you may find my list of Java
IDEs at <http://ide.profectus.com.au> that are comparable to Visual
Studio useful.

The early versions of the standard Java text books seemed to me to be
aimed at programmers changing from C++ to Java. If you can find one
you may find it ideal. I found the constant comparison with a language
that I did not know intensely irritating so I may have exaggerated its
significance.
Manivannan Palanichamy - 12 Jun 2007 18:53 GMT
> >Hello everybody
>
[quoted text clipped - 13 lines]
> that I did not know intensely irritating so I may have exaggerated its
> significance.

When I was a kid, I missed to read 'The Java(TM) Programming Language'
- by James Gosling & Ken Arnold.
I will recommend you not to do the same mistake!  :-)

--
Manivannan.Palanichamy (@) Oracle.com
http://mani.gw.googlepages.com/index.html
Roedy Green - 13 Jun 2007 06:33 GMT
>I have some years of experience with C++ and now need to learn java. I
>appreciate if you could advise me on how to get started.

C++ knowledge gets in the way. So many things in Java LOOK like
familiar C++ constructs but work quite differently.

Be warned Java Strings and arrays bear almost no resemblance to the
C++ equivalents.

You might read the Gotchas, which I wrote to myself as Java surprised
me by not behaving like C++.

see http://mindprod.com/jgloss/gotchas.html
--
Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com
Lew - 13 Jun 2007 11:21 GMT
>> I have some years of experience with C++ and now need to learn java. I
>> appreciate if you could advise me on how to get started.
[quoted text clipped - 9 lines]
>
> see http://mindprod.com/jgloss/gotchas.html

Great link.

Reference semantics differ also.

Signature

Lew

Chris.z - 15 Jun 2007 02:36 GMT
Find some books like "Thinking in java" to start 'cuz you do familiar
with c++, what I suggest is that try to use notepad or EditPlus to
write your code on at the first place, Then use IDE such as Eclipse or
NetBean or JBuilder. Enjoy your java studying...
Lew - 15 Jun 2007 02:57 GMT
>  Find some books like "Thinking in java" to start 'cuz you do familiar
> with c++, what I suggest is that try to use notepad

Ewww!

> or EditPlus

or emacs

> to write your code on at the first place, Then use IDE such as Eclipse or
> NetBean or JBuilder. Enjoy your java studying...

Oh, go ahead and start with an IDE.  You can use it as a "plain" editor that
shows you your syntax mistakes before you compile them.

There's no benefit that I can see at all to starting with a plainer editor;
certainly not Notepad.

Signature

Lew

Roedy Green - 15 Jun 2007 10:30 GMT
>I have some years of experience with C++ and now need to learn java. I
>appreciate if you could advise me on how to get started. In the past,
>I used to work with Visual C++ 5.0 and 6.0 and have recently switched
>to Visual Studio 2005. I see there is a Visual J# available out there.
>Is it the right place to start?

If you have some assembler experience, you might have a peek at the
how JVM byte code works.  

The big problem I had was my assembler/C background and assuming that
under the covers Java worked the same way.  It is very different and
that difference is not documented BECAUSE the JVM layer gives immense
leeway to the implementor. There is almost nothing you can say for
sure about how Java HAS to work under the covers, just how it DOES
work in some particular implementations.

Crucial facts:

1. You can't use pointers/references to peer into the middle of
objects or arrays or primitives.  They always point to the beginning
of objects (which includes arrays and rows in matrices.)

2. objects are not embedded inside other objects.  Instead you have a
pointer to a separately allocated embedded object.

3. Java does automatic garbage collection. see
http://mindprod.com/jgloss/gc.html

4. Matrices are stored as separately allocated rows, not contiguously.
The first subscript indexes a array of pointers.  Rows need not all
have the same length. see
http://mindprod.com/jgloss/gotchas.html#MATRIX

5. arrays are nearly always full.  Partly full arrays or ones that
grow are stored as ArrayLists. see
http://mindprod.com/jgloss/arraylist.html

6. You can never view the same bytes in two different ways using
casts.

7. It is impossible to write a program to determine if you are running
a little or big endian CPU.  You can't index into the middle of an
integer. see http://mindprod.com/jgloss/endian.html

8. Initialising is a multi step process. See
http://mindprod.com/jgloss/gotchas.html#ARRAY
--
Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.