ابدأ بالتواصل مع الأشخاص وتبادل معارفك المهنية

أنشئ حسابًا أو سجّل الدخول للانضمام إلى مجتمعك المهني.

Gopinath Ramkumar
من قبل Gopinath Ramkumar , Lead Quantitative Manager , Hsbc Securities Services

Java is considered as Dynamic because of Byte code [a class file]. A source code written in one platform, that can be executed in any platform. And it also loads the class files at run time. Anything that happens at run time is considered as Dynamic. For better understanding let us compare with C++. One major problem with C++ in a production environment is a side-effect of the way that code is implemented. If company A produces a class library (a library of plug and play components) and company B buys it and uses it in their product, then if A changes its library and distributes a new release, B will almost certainly have to recompile and redistribute their own software. In an environment where the end user gets A and B's software independently (say A is an OS vendor and B is an application vendor) problems can result.

For example, if A distributes an upgrade to its libraries, then all of the software from B will break. It is possible to avoid this problem in C++, but it is extraordinarily difficult and it effectively means not using any of the language's OO features directly.

 

By making these interconnections between modules later, Java completely avoids these problems and makes the use of the object-oriented paradigm much more straightforward. Libraries can freely add new methods and instance variables without any effect on their clients.

Classes have a run time representation: there is a class named Class, instances of which contain run time class definitions. If, in a C or C++ program, you have a pointer to an object but you don't know what type of object it is, there is no way to find out. However, in Java, finding out based on the run time type information is straightforward. Because casts are checked at both compile-time and run time, you can trust a cast in Java. On the other hand, in C and C++, the compiler just trusts that you're doing the right thing.

It is also possible to look up the definition of a class given a string containing its name. This means that you can compute a data type name and have it easily dynamically-linked into the running system.

Mohd shahnawaz khan
من قبل Mohd shahnawaz khan , Associate Project , Cognizant Technology Solution

Java is considered as Dynamic because of Byte code[a class file].

A source code written in one platform, the same code can be executed in any platform[ which JDK is installed.].

And it also loads the class files at run time,anything that happens at run time is considered as dynamic.

Java also has a WORA property(Write Once Run Anywhere)

المزيد من الأسئلة المماثلة