To understand differences between java and python in context of memory,
Let us take one example.
In Java language, when we declare a variable, data type is needed.
For example, float x=12.5
Here, memory of 4 bytes allocated first, then variable x assigned to that memory and value 12.5 stored in the memory.
In Python, x=12.5 means first 12.5 object is created and then variable x is labelled to the x.
Python uses reference counting to free objects as soon as they have no references. This means most of the time everything is cleaned up by reference counting and GC never kicks in. There is also usually no need to tune various GC parameters as in Java.
TCCI teach various Programming Languages like Java, Python , C, C++, Data Structure, DBMS etc.
To know more in detail about Courses at TCCI.
Call us @ 9825618292
Visit us @ http://tccicomputercoaching.com/about-us/
Let us take one example.
In Java language, when we declare a variable, data type is needed.
For example, float x=12.5
Here, memory of 4 bytes allocated first, then variable x assigned to that memory and value 12.5 stored in the memory.
In Python, x=12.5 means first 12.5 object is created and then variable x is labelled to the x.
Python uses reference counting to free objects as soon as they have no references. This means most of the time everything is cleaned up by reference counting and GC never kicks in. There is also usually no need to tune various GC parameters as in Java.
TCCI teach various Programming Languages like Java, Python , C, C++, Data Structure, DBMS etc.
To know more in detail about Courses at TCCI.
Call us @ 9825618292
Visit us @ http://tccicomputercoaching.com/about-us/
No comments:
Post a Comment