admin

Timer TimerTask Java

Timer TimerTask Java Introduction The classes, Timer and TimerTask from java.util package, introduced with JDK 1.3, are used with threads to animate the images at regular intervals of time. If the stipulated (delay) period of time is over, the Timer object can generate events. Simply by handling the event, the programmer can execute some user-defined …

Timer TimerTask Java Read More »

Palindrome Delete Replace Reverse Java Example

Note: Palindrome Example is available in second page. 1. Deleting the Characters To delete characters from StringBuffer, two methods exist – deleteCharAt() and delete(). Supported methods from String class StringBuffer deleteCharAt(int pos): Delete the character in the StringBuffer at the specified index number, pos. StringBuffer delete(int start, int end): Deletes all the characters in the …

Palindrome Delete Replace Reverse Java Example Read More »

Java String Find matching characters indexOf(), lastIndexOf()

To Java String find matching, we use three methods – overloaded indexOf() and lastIndexOf() and charAt(). Index numbers are given by the JVM implicitly to the characters in the string; the first character is given 0, the second one as 1 and so on. These index numbers are helpful in programming in searching operations. Following …

Java String Find matching characters indexOf(), lastIndexOf() Read More »

toUpperCase(), toLowerCase() and replace() String

Here, we do some miscellaneous operations on strings like converting a string from lowercase to uppercase or vice versa, removing unwanted prefix and suffix whitespaces and replacing a few characters with replace() String. Supported methods from String class. String toLowerCase(): Returns a new string containing all lowercase characters. All the uppercase characters are converted into …

toUpperCase(), toLowerCase() and replace() String Read More »

Types of Inheritance Tutorial Java

Types of Inheritance There exists basically three types of inheritance. Multilevel inheritance Multiple inheritance Hierarchical inheritance 1. In single inheritance, one class extends one class only. In multilevel inheritance, the ladder of single inheritance increases. 2. In multiple inheritance, one class directly extends more than one class. 3. In hierarchical inheritance one class is extended …

Types of Inheritance Tutorial Java Read More »

OOPS concepts Tutorial

OOPS concepts Tutorial Summary: By the end of this tutorial "OOPS concepts Tutorial", you will understand the meaning of OOPS concepts. Three basic concepts of OOPS Abstraction Encapsulation Polymorphism 1. Abstraction Abstraction means using the equipment (or code) without knowing the details of working. For example, you are using your mobile phone without knowing how …

OOPS concepts Tutorial Read More »

Java Drawbacks

Even though Java is projected as the most demanded language of the times, but has its own disadvantages. Of course, they are very minor in nature and need not be considered as drawbacks compared to the advantages it brings forward. Following is the list of Java Drawbacks a) Slow performance: The first and foremost drawback …

Java Drawbacks Read More »