A Scanner class breaks its input into tokens using a delimiter pattern, which by default matches white space. The resulting tokens may then be converted into values of different types using the various next methods.
int indexOf(char/String) – returns the index of the first occurrence of the specified character /string in the current string object. If the character/String is not present, it returns -1
Constructor is a member function with the same name as that of a class and is used to initialize the data members of the class with a legal initial value.
The Java Programs need to be written just once which can be run on different platforms without making changes in the Java program. Only the Java interpreter is changed depending upon the platform.
A class represents a set of objects that share common characteristics and behavior. An object is an identifiable entity with some characteristics and behavior.
The keyword “extends†signifies that the properties of super class are extended to the subclass. That means, subclass contains its own members as well of those of the super class.
In Java, member variables have static binding because Java does not allow for polymorphic behavior with member variables. That means if both the Animal class and the Dog class have a member variable with the same name, it's the base class version that is used.
An interface can be implemented by many classes and a class can implement multiple interfaces. All methods in an interface are automatically public and abstract.
"
You gain strength, courage and confidence by every experience in which you really stop to look fear in the face. You are able to say to yourself, 'I have lived through this horror. I can take the next thing that comes along.' You must do the thing you think you cannot do. "