Thread Without Synchronization In Java : An application that creates an instance of Thread must provide the code that will run in that thread. There are two ways to do this: Provide a Runnable object. Subclass Thread. The Thread class itself implements Runnable, though its run method does nothing. To know in details you may visit oracle documentation for threads.
java.util.function.Function is an interface and has been introduced in java 8. Function is a functional interface. So it can be used to accept lambda expression. Function accepts one argument and returns the result. Function interface contains one method that is apply(). This is the functional interface method. Find the declaration of apply() method. R apply(T t) Where T… Read More »
This is a program to calculate number and percentage of Lowercase letters, uppercase letters, digits and other special characters in a string. Output Uppar Case Percentage: 14.29 Lower Case Percentage: 45.71 Digits Percentage: 8.57 Other Percentage: 31.43
This is the program to reverse a string and remove character from index 4 to index 9 from the reversed string using String Buffer. It uses concepts of string Buffer and String Class’ reverse function. Output Original String: This is a new String Reverse String: gnirtS wen a si sihT After Deleting: gniren a si sihT After… Read More »
This is a program to find the number of occurrences of a character in String without using a loop. Approach: We are using replaceAll and length method of Java String Class here to count the number of a particular character in a string. Output Length Of String:35 Length Of String Without A:31 Occurrence Of A Char… Read More »