Java Version wise Features
Java Version wise Features
Features
-Vinoth S P
JDK 1 Features
► The first stable version, JDK 1.0.2, was called Java 1(OAK).
► On February 19, 1997, JDK 1.1 was released having a list of big features such
as:
► AWT event model
► Inner classes
► JavaBeans
► JDBC
► RMI
► Reflection which supported Introspection only, no modification at runtime was
possible.
► JIT (Just In Time) compiler for Windows
► Just-in-time (JIT) compiler is a program that turns Java bytecode into
instructions that can be sent directly to the processor.
► Inner class means one class which is a member of another class. There are
basically four types of inner classes in java
► 1) Nested Inner class
► (access any private instance variable of outer class interface can also be
nested and can have all the access specifiers)
► Objects are created for inner class by -> Outer.Inner in = new Outer().new
Inner();
► we can’t have static method in a nested inner class because an inner class is
implicitly associated with an object of its outer class so it cannot define any
static method for itself. An interface can also be nested and nested interfaces
have some interesting properties.
► 2) Method Local inner classes(Inner class can be declared within a method of
an outer class)
► Method Local inner classes can’t use local variable of outer method until that
local variable is not declared as final.(till JDK 1.7)
Anonymous inner classes
► 3) Anonymous inner classes are declared without any name at all. They are
created in two ways.
a) As subclass of specified type b) As implementer of the specified interface
► 4) Static nested classes
► Like a static member of outer class.
Remote Method Invocation
► JavaBeans are classes that encapsulate many objects into a single object (the
bean).
► It is a java class that should follow following conventions: Must implement
Serializable.
► It should have a public no-arg constructor.
► All properties in java bean must be private with public getters and setter
methods.
► Setter should have return-type should be void.
► The return-type should not be void i.e. according to our requirement we have
to give return-type(Any type).
AWT
► The process of designing web applications in such a way that which provides
support for various countries, various languages and various currency
automatically without performing any change in the application is called
Internationalization.
► 1. Create the Properties Files
► greetings = Hello (MessagesBundle.properties)
► Define the Locale
► A Locale object specified a particular region and language.
► aLocale = new Locale(“en”,”US”);
► frLocale = new Locale(“fr”,”FR”);
► currentLocale = new Locale(language, country);
► Create a ResourceBundle
► messages = ResourceBundle.getBundle(“MessagesBundle”, currentLocale);
► There are two inputs to the getBundle method: the properties file and the
locale. “MessagesBundle” refers to the family of properties files:
► MessagesBundle_en_US.properties
► MessagesBundle_fr_FR.properties
► Fetch the Text from the ResourceBundle
► String msg1 = messages.getString(“greetings”);