JavaStorageAreas2

JavaStorageAreas2 - Memory Storage Areas in Java Java has 3...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Memory Storage Areas in Java
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Java has 3 memory storage areas, traditional for a high-level programming language: 1) a "static" area (sometimes called the "common" or "global" or "shared" area in other languages) that is available to all Java programs, 2) dynamic storage (the C environment calls this the "heap") where all Objects reside, and 3) the "stack" where temporary "local" variables are allocated. _____________________________________________________________________________________ | | | STATIC | | | | * CONTAINS fields and methods (no objects!) | | | | * Fields or Methods are ALLOCATED here by using the keyword "static" on their | | declaration line. e.g. static int x; or static int calculate() | | | | * Fields or Methods here are REFERENCED by using the syntax: DeclaringClassname.field | or DeclaringClassname.method() to eliminate ambiguity of names in this common area| | e.g. System.out and Math.random() | | | | * public Fields or Methods here are ACCESSABLE by all programs running in the JVM. | | | | * Fields and Methods here LIVE until the JVM goes down!
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 01/25/2010 for the course ECE 309 taught by Professor Bowman during the Spring '09 term at N.C. State.

Page1 / 2

JavaStorageAreas2 - Memory Storage Areas in Java Java has 3...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online