what are the purposes of native, transiant key words?

Answer Posted / ranganathkini

When a method is marked with the native keyword. Then it
means that the method is implemented externally in a
non-Java language (more likely C/C++).

Native functions are used to perform operations beyond the
control of JVM. Native methods are by default not portable
unlike the Java programs.

A field that is marked by the transient keyword means that
during serialization of the class instance, that field will
be ignored and not serialized.

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is oops in java?

561


What is the common usage of serialization?

569


What is the importance of hashcode() and equals() methods?

572


What is the maximum size of byte array in java?

532


What are autoboxing and unboxing? When does it occur?

530






What is anagram of a string?

511


How does hashmap work in java ?

537


How many characters is 2 bytes?

524


Why is singleton instance static?

501


What is the difference between a factory and abstract factory pattern?

681


Difference between object instantiation and construction ?

576


What is the size of an array?

545


Does java allow default arguments?

589


Why do we need wrapper class?

533


What is object-oriented paradigm?

606