Vikyath Ram has Published 151 Articles

Get reverse order using Comparator in Java

Vikyath Ram

Vikyath Ram

Updated on 30-Jun-2020 08:16:08

486 Views

The objects of a user defined class can be ordered using the Comparator interface in Java. The java.util.Collections.reverseOrder() method reverses the order of an element collection using a Comparator.A program that demonstrates this is given as follows −Exampleimport java.util.Arrays; import java.util.Collections; import java.util.Comparator; public class Demo {    public static ... Read More

Add elements to a Vector in Java

Vikyath Ram

Vikyath Ram

Updated on 30-Jun-2020 08:11:22

1K+ Views

A dynamic array is implemented by a Vector. This means an array that can grow or reduce in size as required.Elements can be added at the end of the Vector using the java.util.Vector.add() method. This method has a single parameter i.e. the element to be added. It returns true if ... Read More

Matcher.pattern() method in Java Regular Expressions

Vikyath Ram

Vikyath Ram

Updated on 30-Jun-2020 08:05:47

83 Views

The method java.time.Matcher.pattern() returns the pattern that is matched upon by the Matcher. This method accepts no parameters.A program that demonstrates the method Matcher.pattern() in Java regular expressions is given as follows −Example Live Demoimport java.util.regex.Matcher; import java.util.regex.Pattern; public class Demo {    public static void main(String args[]) {     ... Read More

Private and final methods in Java Programming

Vikyath Ram

Vikyath Ram

Updated on 27-Jun-2020 08:12:16

6K+ Views

In Java private methods are the methods having private access modifier and are restricted to be access in the defining class only and are not visible in their child class due to which are not eligible for overridden. However, we can define a method with the same name in the ... Read More

How to using string writer append in android?

Vikyath Ram

Vikyath Ram

Updated on 26-Jun-2020 14:07:06

1K+ Views

This example demonstrate about how to using string writer append in android.Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.Step 2 − Add the following code to res/layout/activity_main.xml           ... Read More

How to use Synchronized list in android listview?

Vikyath Ram

Vikyath Ram

Updated on 26-Jun-2020 14:05:18

183 Views

This example demonstrate about How to use Synchronized list in android listview.Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.                 In the above code, ... Read More

How to print number of words in textview in android?

Vikyath Ram

Vikyath Ram

Updated on 26-Jun-2020 14:02:11

490 Views

This example demonstrate about How to print number of words in textview in android.Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.Step 2 − Add the following code to res/layout/activity_main.xml.     ... Read More

How to merge two arrays without duplication in android listview?

Vikyath Ram

Vikyath Ram

Updated on 26-Jun-2020 13:05:56

441 Views

This example demonstrate about How to merge two arrays without duplication in android listview.Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.Step 2 − Add the following code to res/layout/activity_main.xml       ... Read More

How to give on click listener for footer view in android listview?

Vikyath Ram

Vikyath Ram

Updated on 26-Jun-2020 13:04:41

212 Views

This example demonstrate about How to give on click listener for footer view in android listview.Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.Step 2 − Add the following code to res/layout/activity_main.xml   ... Read More

How to extend an array after initialization in android listview?

Vikyath Ram

Vikyath Ram

Updated on 26-Jun-2020 12:52:41

125 Views

This example demonstrate about How to extend an array after initialization in the android listview.Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.Step 2 − Add the following code to res/layout/activity_main.xml     ... Read More

Advertisements