Starting java with C++ background

Discussion in 'Java' started by Afshin, Jun 11, 2007.

  1. Afshin

    Afshin Guest

    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
    Afshin, Jun 11, 2007
    #1
    1. Advertising

  2. Afshin

    Lew Guest

    Afshin wrote:
    > 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?


    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.

    --
    Lew
    Lew, Jun 11, 2007
    #2
    1. Advertising

  3. Afshin

    Ian Wilson Guest

    Afshin wrote:
    > 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?
    >


    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.
    Ian Wilson, Jun 11, 2007
    #3
  4. Afshin

    rossum Guest

    On Mon, 11 Jun 2007 02:42:28 -0700, Afshin <>
    wrote:

    >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

    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
    rossum, Jun 11, 2007
    #4
  5. "rossum" <> wrote in message
    news:...
    > On Mon, 11 Jun 2007 02:42:28 -0700, Afshin <>
    > wrote:
    >
    >>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

    > 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.
    Mike Schilling, Jun 12, 2007
    #5
  6. Mike Schilling wrote:
    > "rossum" <> wrote in message
    > news:...
    >> On Mon, 11 Jun 2007 02:42:28 -0700, Afshin <>
    >> 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,
    >>> 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

    >> J# is not Java,

    >
    > 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#.

    >
    > 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.


    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
    =?ISO-8859-1?Q?Arne_Vajh=F8j?=, Jun 12, 2007
    #6
  7. Afshin

    David Segall Guest

    rossum <> wrote:


    >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.
    David Segall, Jun 12, 2007
    #7
  8. Afshin

    David Segall Guest

    Afshin <> wrote:

    >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
    David Segall, Jun 12, 2007
    #8
  9. Afshin

    David Segall Guest

    Afshin <> wrote:

    >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?

    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.
    David Segall, Jun 12, 2007
    #9
  10. On Jun 12, 7:01 pm, David Segall <> wrote:
    > Afshin <> wrote:
    > >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?

    >
    > 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.


    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
    Manivannan Palanichamy, Jun 12, 2007
    #10
  11. David Segall wrote:
    > rossum <> wrote:
    >> 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.


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

    Arne
    =?ISO-8859-1?Q?Arne_Vajh=F8j?=, Jun 13, 2007
    #11
  12. Afshin

    Roedy Green Guest

    On Mon, 11 Jun 2007 02:42:28 -0700, Afshin <>
    wrote, quoted or indirectly quoted someone who said :

    >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
    Roedy Green, Jun 13, 2007
    #12
  13. Afshin

    Lew Guest

    Roedy Green wrote:
    > On Mon, 11 Jun 2007 02:42:28 -0700, Afshin <>
    > wrote, quoted or indirectly quoted someone who said :
    >
    >> 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


    Great link.

    Reference semantics differ also.

    --
    Lew
    Lew, Jun 13, 2007
    #13
  14. Ian Wilson wrote:
    ....
    > 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
    Patricia Shanahan, Jun 13, 2007
    #14
  15. Afshin

    David Segall Guest

    Arne Vajhøj <> wrote:

    >David Segall wrote:
    >> rossum <> wrote:
    >>> 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.

    >
    >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, Jun 13, 2007
    #15
  16. Afshin

    Chris.z Guest

    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...
    Chris.z, Jun 15, 2007
    #16
  17. Afshin

    Lew Guest

    Chris.z wrote:
    > 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.

    --
    Lew
    Lew, Jun 15, 2007
    #17
  18. Afshin

    Roedy Green Guest

    On Mon, 11 Jun 2007 02:42:28 -0700, Afshin <>
    wrote, quoted or indirectly quoted someone who said :

    >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
    Roedy Green, Jun 15, 2007
    #18
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Miguel De Anda
    Replies:
    3
    Views:
    11,226
    Ivan S Kirkpatrick
    Jul 3, 2003
  2. Paul Hampton
    Replies:
    0
    Views:
    345
    Paul Hampton
    Jul 3, 2003
  3. mason66
    Replies:
    0
    Views:
    422
    mason66
    Jul 27, 2006
  4. JWL
    Replies:
    4
    Views:
    587
    Michael Winter
    Sep 26, 2006
  5. jc
    Replies:
    3
    Views:
    1,728
Loading...

Share This Page