What is "dynamic" about Java?
hi
I'm new to Java and programing in general
There are few things I don't understand about Java and OOP in general.
1)
How does memory allocation in Java differ from memory allocation in, say, C or pascal?
* memory for all the variables declared in C is allocated at compile time. This way program can figure out at compile time whether there is enough memory to run a program.
In Java memory for primitive types is allocated at compile time, but memory for objects is allocated at run time.
So in other words, program has no way of knowing ( prior to running ) whether there is enough memory to run the program?
2)
Word "dynamic" is often used when talking about java. Does word dynamic in context of Java only refer to dynamic memory allocation, or does Java have some other "dynamic" features also?
thank you
[882 byte] By [
kajalovea] at [2007-11-27 5:07:39]

> So in other words, program has no way of knowing (
> prior to running ) whether there is enough memory to
> run the program?
Nope. You'll get the dreaded OutOfMemoryException if there is a problem in that vein.
> 2)
> Word "dynamic" is often used when talking about java.
> Does word dynamic in context of Java only refer to
> dynamic memory allocation, or does Java have some
> other "dynamic" features also?
I have no context here... who's calling it dynamic? Could be a lot of things.
Dynamic memory allocation...
Dynamic runtime type checking...
> hi
>
> I'm new to Java and programing in general
>
> There are few things I don't understand about Java
> and OOP in general.
>
> 1)
> How does memory allocation in Java differ from memory
> allocation in, say, C or pascal?
The most practical difference is that java is designed so you don't have to care about memory management. Memory is allocated and deallocated automatically by the vm.
> * memory for all the variables declared in C is
> allocated at compile time. This way program can
> figure out at compile time whether there is enough
> memory to run a program.
> In Java memory for primitive types is allocated at
> compile time, but memory for objects is allocated at
> run time.
> So in other words, program has no way of knowing (
> prior to running ) whether there is enough memory to
> run the program?
>
>
> 2)
> Word "dynamic" is often used when talking about java.
> Does word dynamic in context of Java only refer to
> dynamic memory allocation, or does Java have some
> other "dynamic" features also?
I'm also not familiar with java being called dynamic.
> thank you
1. You could start [url http://en.wikipedia.org/wiki/Dynamic_memory_allocation]here[/url]
2. I think it's quite laudable that you are interested in data structures and memory usage so early in the "learning curve", but I am also intriged as to why you feel you need to know this if you are really just starting out.
At any rate, remember that c, before c++'s enhancements is not Object Oriented; although there are data structures, these are not the same as real OO classes.
One of the early white papers on Java: The Java Language Environment, by
Henry McGilton and my brother from another mother, James Gosling (1996),
http://java.sun.com/docs/white/langenv/
introduced a familiar string of adjectives to describe Java:
* Simple, Object Oriented, and Familiar
* Robust and Secure
* Architecture Neutral and Portable
* High Performance
* Interpreted, Threaded, and Dynamic
About dynamic, they wrote:
<quote>
While the Java Compiler is strict in its compile-time static checking, the language and run-time system are dynamic in their linking stages. Classes are linked only as needed. New code modules can be linked in on demand from a variety of sources, even from sources across a network. In the case of the HotJava Browser and similar applications, interactive executable code can be loaded from anywhere, which enables transparent updating of applications. The result is on-line services that constantly evolve; they can remain innovative and fresh, draw more customers, and spur the growth of electronic commerce on the Internet.
</quote>
Seems a bit quaint, today.
I like quaint - quaint is nice.
> 2)
> Word "dynamic" is often used when talking about java.
> Does word dynamic in context of Java only refer to
> dynamic memory allocation, or does Java have some
> other "dynamic" features also?
Rene's Law of Anti-Static: "In most cases, whatever follows the word 'dynamic' isn't worth reading."
Well-proven in this forum. Look for posts that begin like "how can I dynamically...".
> I like quaint - quaint is nice.
It makes them seem unaware of 20th century political and social developments, such as Fidel Castro replacing Fulgencio Batista as the President of Cuba, Siam changing its name to Thailand, the Belgian Congo changing its name to the Congo-Kinshasa, Prussia being absorbed into the German Empire, India gaining its independence from the British Empire, New Mexico entering the United States, Idlewild Airport changing its name to JFK Airport, the disbanding of the Negro Leagues, the desegregation of the Major Leagues, Joe DiMaggio no longer being a rookie, the extinction of the dodo bird, the discrediting of phrenology, the demolition of the Polo Grounds, the ceasing of publication of Collier's Weekly, believing tires need to be revulcanized, thinking cars are still operated by levers, believing mail may still be delivered by autogyro, and the occurrence of the 1939 World's Fair.
> the discrediting of phrenologyYou mean the bumps on my head are just... bumps?Blasphemy!
What is dynamic about Java?The FUN!!!!
No quiant like:
Sitting in the sun with a book on Java;
going back inside by the lamp with Lava.
Swimming in the stream having nay a botha;
laying on the shore to rest when I feel I'd ratha.
Flying paper kites at the beach in summer;
feeling wind in my hair, hear a distant hum<m>er.
Going to the strip, hear the distant thunder;
hear the flathead roar, see the red-light blunder.
~Bill
How come the cuss filter catches ****** but not fuckery? Haven't they got the Amy Winehouse patch?
You might want to ask ****...