Life Web Directory » Article Details

Building Secure Applets with Java

Date Added: October 09, 2009 02:59:18 PM
Author: strailjemson
Category: Computers: Intranet
Java programs do not use pointers explicitly. Objects are accessed by getting a handle to the object. Effectively, this is like getting a pointer to an object, but Java does not allow the equivalent of pointer arithmetic on object handles. Object handles cannot be modified in any way by the Java applet or application. C and C++ programmers are used to manipulating pointers to implement strings and to implement arrays. Java has high-level support for both strings and arrays, so programmers don't need to resort to pointer arithmetic in order to use those data structures. Arrays are bounds-checked at runtime. Using a negative index causes a runtime exception, and using an index that is larger than the size of the array causes a runtime exception. Once an array object is created, its length never changes. Strings in Java are immutable. A string is zero or more characters enclosed in double quotes, and it's an instance of the String class. Using immutable strings can help prevent common runtime errors that could be exploited by hostile applets. The Java compiler checks that all type casts are legal. Java is a strongly typed language, unlike C or C++, and objects cannot be cast to a subclass without an explicit runtime check. The final modifier can be used when initializing a variable, to prevent runtime modification of that variable. The compiler catches attempts to modify final variables. Before a method is invoked on an object, the compiler checks that the object is the correct type for that method. For example, invoking t.currentThread() when t is not a Thread object causes a compile time error. Java provides four access modifiers for methods and variables defined within classes and makes sure that these access barriers are not violated. public: a public method is accessible anywhere the class name is accessible protected: a protected method is accessible by a child of a class as long as it is trying to access fields in a similarly typed class. For example, class Parent { protected int x; } class Child extends Parent { ... } The class Child can access the field "x" only on objects that are of type Child (or a subset of Child.) private: a private method is accessible only within its defining class default: if no modifier is specified, then by default, a method is accessible only within its defining package For example, programmers can choose to implement sensitive functions as private methods. The compiler and the runtime checks ensure that no objects outside the class can invoke the private methods.
You must be logged in to leave a rating.
Average rating: (0 votes)

No Comments Yet.


You must be logged in to leave a rating.
Latest Articles

Helpful Hints On Video Downloads

If you are interested in downloading movies and soundtracks from the Internet you will find useful information and recommendations about the procedure and benefits in this article.

Formatted data or files can be easily return from storage Media.

If you have lost important data from usb drive or from pc due to any reason so they can easily get back easily and also return complete lost files and folders and other important documents from any storage media in single click.

Cognitive Info About Rapidshare Search

The article describes the opportunities of downloading media files from the Internet for free. Get to know how to search and find the requested free downloads.

Interesting Facts About Iphone Software

The article is dedicated to the description of numerous applications for iphone that are available on the Internet free of charge. Get to know how to download top iphone software.

Amazing Facts About Stereophotos

The article is dedicated to the description of optical illusions and stereo photos. Much attention is paid to the process how to watch stereograms and other optical illusions.