Results 1 to 20 of 21
Thread: java -- memory concepts
- 12-16-2010, 10:13 AM #1
Member
- Join Date
- Dec 2010
- Posts
- 38
- Rep Power
- 0
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
- 12-16-2010, 10:36 AM #2
Moderator
- Join Date
- Apr 2009
- Posts
- 10,448
- Rep Power
- 16
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.
- 12-16-2010, 12:28 PM #3
Member
- Join Date
- Dec 2010
- Posts
- 38
- Rep Power
- 0
so why they made such a design ,,,,,,it would be better if they had allowed multiple inheritence..i mean using two extends
- 12-16-2010, 01:02 PM #4
Moderator
- Join Date
- Apr 2009
- Posts
- 10,448
- Rep Power
- 16
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.
- 12-16-2010, 01:33 PM #5
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,394
- Blog Entries
- 7
- Rep Power
- 17
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,
JosWhen people rob a bank they get a penalty; when banks rob people they get a bonus.
- 12-17-2010, 07:23 AM #6
Member
- Join Date
- Dec 2010
- Posts
- 38
- Rep Power
- 0
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......
- 12-17-2010, 07:27 AM #7
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,394
- Blog Entries
- 7
- Rep Power
- 17
When people rob a bank they get a penalty; when banks rob people they get a bonus.
- 12-17-2010, 07:36 AM #8
Member
- Join Date
- Dec 2010
- Posts
- 38
- Rep Power
- 0
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
- 12-17-2010, 07:44 AM #9
Member
- Join Date
- Dec 2010
- Posts
- 38
- Rep Power
- 0
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
- 12-17-2010, 08:00 AM #10
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,394
- Blog Entries
- 7
- Rep Power
- 17
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,
JosWhen people rob a bank they get a penalty; when banks rob people they get a bonus.
- 12-17-2010, 08:04 AM #11
Member
- Join Date
- Dec 2010
- Posts
- 38
- Rep Power
- 0
ok,,,,,,,now i am relieved bcz whomsoever i have seen all have studied c++ before
- 12-17-2010, 08:20 AM #12
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,394
- Blog Entries
- 7
- Rep Power
- 17
- 12-17-2010, 08:58 AM #13
Member
- Join Date
- Dec 2010
- Posts
- 38
- Rep Power
- 0
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.?
- 12-17-2010, 09:08 AM #14
Moderator
- Join Date
- Apr 2009
- Posts
- 10,448
- Rep Power
- 16
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.
- 12-17-2010, 11:26 AM #15
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,394
- Blog Entries
- 7
- Rep Power
- 17
- 12-17-2010, 01:07 PM #16
Member
- Join Date
- Dec 2010
- Posts
- 38
- Rep Power
- 0
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.
- 12-17-2010, 01:17 PM #17
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,394
- Blog Entries
- 7
- Rep Power
- 17
- 12-17-2010, 01:22 PM #18
Moderator
- Join Date
- Apr 2009
- Posts
- 10,448
- Rep Power
- 16
- 12-17-2010, 01:32 PM #19
Member
- Join Date
- Dec 2010
- Posts
- 38
- Rep Power
- 0
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.
- 12-17-2010, 01:39 PM #20
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,394
- Blog Entries
- 7
- Rep Power
- 17
Similar Threads
-
is there INK and STROKES concepts in java
By javadoubt@gmail.com in forum Java 2DReplies: 2Last Post: 02-24-2010, 07:52 PM -
Concepts escaping me?!
By skatefreak in forum New To JavaReplies: 2Last Post: 04-29-2009, 02:36 PM -
[SOLVED] Java compiling concepts
By SomeGuyOverThere in forum New To JavaReplies: 9Last Post: 08-20-2008, 10:47 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks