marq

Dr. Charles Simonyi is the Father of Modern Microsoft Excel                                           JavaScript was originally developed by Brendan Eich of Netscape under the name Mocha, later LiveScript, and finally renamed to JavaScript.                                           The word "Biology" is firstly used by Lamarck and Treviranus                                           Hippocrates (460-370 bc) is known as father of medicine.                                           Galene, 130-200 is known as father of Experimental Physology                                           Aristotle (384-322 BC) is known as Father of Zoology because he wrote the construction and behavior of different animals in his book "Historia animalium"                                           Theophrastus(370-285 BC) is known as father of Botany because he wrote about 500 different plants in his book "Historia Plantarum".                                           John Resig is known as Father of Jquery -                                          HTML is a markup language which is use to design web pages. It was invented in 1990 by Tim Berners-Lee.                                                                The Google was founded by Larry Page and Sergey Brin.                                                                Rasmus Lerdorf was the original creator of PHP. It was first released in 1995.                                                               Facebook was founded by Mark Zuckerberg                                                               Bjarne Stroustrup, creator of C++.                                                                Dennis Ritchie creator of C                                                                                                                              James Gosling, also known as the "Father of Java"                                          At 11.44%, Bihar is India's fastest growing state                                          Father of HTML -Tim Berners Lee                                          orkut was created by Orkut Büyükkökten, a Turkish software engineer                    Photoshop: It came about after Thomas Knoll, a PhD student at the University of Michigan created a program to display grayscale images on a monochrome monitor which at the time was called 'Display'.

Access Modifiers in java



abstract 

This applies to classes and methods.

A class must be declared abstract if any of the following conditions is true :
  • The class has any abstract methods.
  • The class inherits any abstract methods but does not implement them.
  • The class declares that it implements an interface but does not implement all of its methods.
In a way, abstract is the opposite to final. A final class cannot be sub-classed but an abstract class must be sub-classed. An abstract class can have non-abstract methods.

When applied to a method, it means that it has not been implemented in its class. Any other class extending this class must either implement the inherited abstract method or itself be declared abstract.

final

This applies to classes, methods and variables.

A variable can be declared as final. Doing so prevents its contents being changed. This means a final variable must be initialized when it is declared. It is common coding convention to choose all uppercase identifiers for ‘final’ variables. Final variables do not occupy memory on a per-instance basis. Thus, it is essentially a constant. If a final variable is a reference to an object, it is the reference that must stay the same, not the object. It means that the reference cannot be assigned to some other object, but data of the object can be changed.

final class cannot be sub-classed.

final method cannot be overridden.

static

This can be applied to variables, methods and initializer blocks.

When applied to a variable, the variable belongs to the class itself and not to its objects. All the objects of the class share the variable. If you modify the value of a static variable in one object, the value gets changed for all the objects of the class since there is only one variable being shared among all the objects.

static initializer block is executed when the class is loaded.

Methods declared static have several restrictions:
  • They can only call other static methods.
  • They must only access static data.
  • They cannot refer to ‘this’ or ‘super’ in anyway.
  • static method cannot be overridden to be non static.

native

It can be applied to methods only.
It indicates that the method body is to be found elsewhere i.e. outside the JVM, in a library. Native code is written in a non java language and compiled for a single target machine type.

transient

It applies only to variables. A transient variable is not stored as part of its object’s persistent state. Many objects, especially those implementing Serializable or Externalizable interfaces, can have their states serialized and written to some destination outside the JVM. This is done by passing the object to the writeObject() method of the ObjectOutputStream class. If the stream is chained to a file output stream, then the object’s state is written to a file. If the stream is chained to a socket’s output stream then the object’s state is written to the network. In both cases, the object can be reconstituted by reading from an object input stream.

There will be times when an object will contain extremely sensitive data. Once an object is written to a  destination outside JVM, none of the Java’s elaborate security mechanisms is in effect. If you declare a variable transient, it’s value will not be written out during serialization.

volatile

It is applied only to variables. It indicates that such variables might be modified asynchronously, so the compiler takes special precautions. Volatile variables are of interest in multi-processor environments.

public

A class, method or variable declared public can be accessed by any other code in a program.

private

This member can only be accessed by other members of its class.

default

when a member does not have an explicit access specification, it is visible to subclass as well as to other classes in the same package.

protected

This allows access from everywhere but except for different package non-subclass.

Note: You cannot combine some of these modifiers together. Some of the cases are:
  • No two access modifiers can be combined. Such as public privateprotected public or private protected.
  • abstract and final.
  • Native methods cannot be abstract, or strictfp.
  • An abstract method cannot be staticfinalsynchronizednativeprivate, or strictfp.
     

No comments:

Post a Comment