Key value pairs are used to hold the initialization parameters. They're in the init-param tags of the web.xml file. The param-name tags are used to specify the key, while the param-value tags are used to specify the value. The ServletConfig object is used to retrieve servlet initialization parameters.
Servlet init parameters are defined for each servlet within the element. Each servlet has its own set of parameters. They are available as arguments in the servlet's init function. This will be used to load values into the servlet for the first time.
Every variable should be correctly initialised, according to Java designers. Giving a variable a correct beginning value is called initialization. It's so critical that Java either does it for you or tells you that an error has happened and that you need to initialise a variable.
However, if you declare an instance variable static and final, the Java compiler will not initialise it in the default function Object() { [native code] }; thus, static and final variables must be initialised. If you don't, you'll get a build time error.
Share a personalized message with your friends.