The native and synchronized KeywordsMethods can also be declared to be native or synchronized . A native method is one that is written in a programming language other than Java. This book focuses on Java code development, but you may very well have legacy code that you would like to incorporate into your Java programs. For more information on utilizing native code, see Essential JNI: Java Native Interface by Rob Gordon. A synchronized method is one that ensures thread-safe data access. In other words, two threads would not be able to simultaneously change the value of a variable in a synchronized method. Synchronization becomes a concern when developing multithreaded programs. As that is not a focus of this book, we won't spend any significant time on synchronized methods. For an informative chapter on synchronization, consult Java How-to Program by Harvey M. Deitel and Paul J. Deitel. |