Page 1 of 2 12 LastLast
Results 1 to 20 of 21
  1. #1
    ron2794 is offline Member
    Join Date
    Dec 2010
    Posts
    38
    Rep Power
    0

    Default java -- memory concepts

    , is there any way of studying java in terms of memory or what we call such a study.,,,,,,,,
    i mean that we should know how everything is terms how everything is working inside....i know now the syntax , but what about why some things are enforced in it. for eg. why we cannot use extends more than one time or there are many such things ,,,,, that i want to learn in terms of memory,....

    kindly tell me how to study this way...............bcz i feel that if i am studying java today bcz it is popular then tomorrow there may be another language then my knowledge is waste but the memory concept will not change that instantaneously so i want a way to study java in terms of memory.............

    HELP plz

  2. #2
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,949
    Rep Power
    19

    Default

    You're mixing up ideas here, since the "can only extend from one class" is not a memory thing but a design decision.

    For an overview of Java try the Java Language Specification for starters. That's a chunky PDF, in case you have a slow connection.

    Also, when asking these sort of questions, it helps if you formulate your question clearly before posting. Because that lot just isn't easy to figure out what it is you are after.

  3. #3
    ron2794 is offline Member
    Join Date
    Dec 2010
    Posts
    38
    Rep Power
    0

    Default

    so why they made such a design ,,,,,,it would be better if they had allowed multiple inheritence..i mean using two extends

  4. #4
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,949
    Rep Power
    19

    Default

    Simplification possibly?
    I don't know, you'd have to ask the designers.

    Multiple inheritance causes its own problems, and in any case coding against an interface has proved to be a good development technique.

  5. #5
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,445
    Blog Entries
    7
    Rep Power
    20

    Default

    Quote Originally Posted by ron2794 View Post
    so why they made such a design ,,,,,,it would be better if they had allowed multiple inheritence..i mean using two extends
    You don't know what you're asking for: single inheritance of implementation leaves the 'this' pointer alone as long as the object exists. Multiple inheritance of implementation (and optional casting) makes the 'this' pointer move around (thunks or 'pointer fixups') in a very tricky way. Doing it wrong (i.e. the casting) is not type safe and can have disastrous results. Google for "C++ multiple inheritance this pointer" and see the trickery dickery involved. This site clearly explains it. One of the other search results is a paper by Bjarne Stroustrup himself and presents you all the gory details involved.

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  6. #6
    ron2794 is offline Member
    Join Date
    Dec 2010
    Posts
    38
    Rep Power
    0

    Default

    Thats what i was asking for ?
    all these like concepts of pointers and all that...............is there any book that make us understand all this in terms of memory,,.........how things work, why only this and not that......

  7. #7
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,445
    Blog Entries
    7
    Rep Power
    20

    Default

    Quote Originally Posted by ron2794 View Post
    Thats what i was asking for ?
    all these like concepts of pointers and all that...............is there any book that make us understand all this in terms of memory,,.........how things work, why only this and not that......
    Yep, that's what you were asking for; read Bjarne Stroustup's article; it's all about memory management. Multiple inheritance of implementation is a real mess and requires a lot of fiddling with the 'this' pointer.

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  8. #8
    ron2794 is offline Member
    Join Date
    Dec 2010
    Posts
    38
    Rep Power
    0

    Default

    does it make us understand all the memory concepts from the very beginning.......i mean right from the place where the concept of memory begins,,, bcz m a beginner and 16 , so i dont know what a pointer is in detail ,, however i know abt pointer in stack overflow that stacks arranges....and pointer then push the things and pull .....bla bla

  9. #9
    ron2794 is offline Member
    Join Date
    Dec 2010
    Posts
    38
    Rep Power
    0

    Default

    bjarne stroupstrup seems to be more towards C++ rather than java,, so does it mean that you have to study c++ before you do java.........i have already jumped to java as my first language ...now do i need to study c++ also for getting the concepts more clearer in java

  10. #10
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,445
    Blog Entries
    7
    Rep Power
    20

    Default

    Quote Originally Posted by ron2794 View Post
    bjarne stroupstrup seems to be more towards C++ rather than java,, so does it mean that you have to study c++ before you do java.........i have already jumped to java as my first language ...now do i need to study c++ also for getting the concepts more clearer in java
    You don't have to study C++ before you can study Java but C++ implements multiple inheritance of implementation while Java doesn't. C++ is the best known language close to Java so I suggested those articles. I couldn't suggest Objective C because it doesn't implement multiple inheritance of implementation either (it does implement some other very interesting features but they are completely alien to Java). Other languages do implement MI but since you're a beginner they'll only confuse you more.

    To keep things simple: the heap is under control of the JVM, you, as a programmer can't do anything about it. Objects are all stored somewhere in that heap and the garbage collector manages it. Let it do its job and all will be fine.

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  11. #11
    ron2794 is offline Member
    Join Date
    Dec 2010
    Posts
    38
    Rep Power
    0

    Default

    ok,,,,,,,now i am relieved bcz whomsoever i have seen all have studied c++ before

  12. #12
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,445
    Blog Entries
    7
    Rep Power
    20

    Default

    Quote Originally Posted by ron2794 View Post
    ok,,,,,,,now i am relieved bcz whomsoever i have seen all have studied c++ before
    Don't feel relieved; there's nobody who can force you to study C++ but there's also noone who can forbid you to study it. It's a huge and interesting language.

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  13. #13
    ron2794 is offline Member
    Join Date
    Dec 2010
    Posts
    38
    Rep Power
    0

    Default so

    directly or indirectly you mean to say that i must study this language...................bcz its more interesting than java................and it will enhance my skill of programming.?

  14. #14
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,949
    Rep Power
    19

    Default

    What is it you need to know?
    (And cut down on the '.' and ',', and the txt spk. It makes it hard to interpret what you're saying at times)

    If it's how memory works then you need to learn the basics of computer memory and the like, which is not Java related. That's why Jos mentions C++.

    If you want to know how Java memory works then read the Language Spec and the JVM book (whose name I forget, but Jos might remember) in which you'll find explanations of how the JVM works. You won't find the answer to why certain design decisions were taken, though.

  15. #15
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,445
    Blog Entries
    7
    Rep Power
    20

    Default

    Quote Originally Posted by Tolls View Post
    If you want to know how Java memory works then read the Language Spec and the JVM book (whose name I forget, but Jos might remember)
    I can't remember I ever forgot something; the JVM specification was written by Tim Lindholm and Frank Yellin.

    kind regards,

    Jos ;-)
    cenosillicaphobia: the fear for an empty beer glass

  16. #16
    ron2794 is offline Member
    Join Date
    Dec 2010
    Posts
    38
    Rep Power
    0

    Default

    wat abt the the complete reference by schildt 5th edition.

    is language spec. better than complete reference, i have both of them as ebook, which one should i use.

  17. #17
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,445
    Blog Entries
    7
    Rep Power
    20

    Default

    Quote Originally Posted by ron2794 View Post
    wat abt the the complete reference by schildt 5th edition.
    Burn it; Herbert Schildt is only in it for the money and all of his books are a waste of trees and belong in the fire place.

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  18. #18
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,949
    Rep Power
    19

    Default

    Quote Originally Posted by JosAH View Post
    Burn it; Herbert Schildt is only in it for the money and all of his books are a waste of trees and belong in the fire place.

    kind regards,

    Jos
    I'm only in it for the money.
    I never wanted to be a programmer you know...(fill in the rest yourself).

  19. #19
    ron2794 is offline Member
    Join Date
    Dec 2010
    Posts
    38
    Rep Power
    0

    Default ooooo

    i live in india and i have observed a huge popularity of his books, i thought he is best and his books are best.

  20. #20
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,445
    Blog Entries
    7
    Rep Power
    20

    Default

    Quote Originally Posted by Tolls View Post
    I'm only in it for the money.
    Argh, why are all you men such capitalist swines! Bah!

    kindest regards,

    Loretta (<--- never wanted to be a lumberjack)
    cenosillicaphobia: the fear for an empty beer glass

Page 1 of 2 12 LastLast

Similar Threads

  1. is there INK and STROKES concepts in java
    By javadoubt@gmail.com in forum Java 2D
    Replies: 2
    Last Post: 02-24-2010, 07:52 PM
  2. Concepts escaping me?!
    By skatefreak in forum New To Java
    Replies: 2
    Last Post: 04-29-2009, 02:36 PM
  3. [SOLVED] Java compiling concepts
    By SomeGuyOverThere in forum New To Java
    Replies: 9
    Last Post: 08-20-2008, 10:47 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •