Manikanth Mani has Published 48 Articles

How does the Java compareTo() method, compare strings?

Manikanth Mani

Manikanth Mani

Updated on 26-Feb-2020 09:41:58

92 Views

The compareTo() method compares the Number object that invoked the method to the argument. It is possible to compare Byte, Long, Integer, etc.However, two different types cannot be compared, both the argument and the Number object invoking the method should be of the same type.ExampleLive Demopublic class Test {    public ... Read More

How to use equals() and equalsIgnoreCase() in Java.

Manikanth Mani

Manikanth Mani

Updated on 26-Feb-2020 06:37:53

249 Views

The equals() methodThis method compares this string to the specified object. The result is true if and only if the argument is not null and is a String object that represents the same sequence of characters as this object.Exampleimport java.lang.*; public class StringDemo {    public static void main(String[] args) ... Read More

concat(), replace(), and trim() Strings in Java.

Manikanth Mani

Manikanth Mani

Updated on 26-Feb-2020 06:27:31

1K+ Views

The concat() method of the String class appends one String to the end of another. The method returns a String with the value of the String passed into the method, appended to the end of the String, used to invoke this method.Examplepublic class Test {    public static void main(String ... Read More

The Optimum Method to Concatenate Strings in Java.

Manikanth Mani

Manikanth Mani

Updated on 26-Feb-2020 06:02:08

125 Views

The Optimum Method to Concatenate Strings in Java is the concat() method.This method appends one String to the end of another. The method returns a String with the value of the String passed into the method, appended to the end of the String, used to invoke this method.ExampleLive Demopublic class ... Read More

Manipulating Strings in Java.

Manikanth Mani

Manikanth Mani

Updated on 26-Feb-2020 05:12:20

512 Views

Since String class is immutable once created we cannot modify the data of the string. But still if you want to manipulate string data you can rely on StringBuffer or StringBuilder classes.Examplepublic class Test {    public static void main(String args[]) {       String str = "Hi welcome ... Read More

How do I time a method execution in Java

Manikanth Mani

Manikanth Mani

Updated on 25-Feb-2020 05:01:54

734 Views

You should get a start time before making a call and end time after method execution. The difference is the time taken. ExampleLive Demoimport java.util.Calendar; public class Tester {    public static void main(String[] args) {       long startTime = Calendar.getInstance().getTimeInMillis();       longRunningMethod();       long ... Read More

Using ABAP Function module RSAQ_REMOTE_QUERY_CALL, NO_DATA_SELECTED exception using selection parameters

Manikanth Mani

Manikanth Mani

Updated on 14-Feb-2020 05:44:59

276 Views

As SAP provides flexible options that allow selection parameters easy to use. As you are using multiple parameters please note the following:Set KIND to “s” only for using select option. If you are using parameters, it should be “P”Instead of using EN, try using internal language “E”RSAQ_REMOTE_QUERY_FIELDLIST- this function module ... Read More

Standard Input Stream (cin) in C++

Manikanth Mani

Manikanth Mani

Updated on 10-Feb-2020 13:39:48

5K+ Views

std::cin is an object of class istream that represents the standard input stream oriented to narrow characters (of type char). It corresponds to the C stream stdin. The standard input stream is a source of characters determined by the environment. It is generally assumed to be input from an external ... Read More

How can we extract a substring from the value of a column in MySQL table?

Manikanth Mani

Manikanth Mani

Updated on 07-Feb-2020 05:51:23

656 Views

We can apply any of the functions like SUBSTRING(), MID() or SUBSTR() to extract a substring from the value of a column. In this case, we must have to provide the name of the column as the first argument of the function i.e. at the place of string we have ... Read More

How can I remove the leading and trailing spaces both at once from a string by using MySQL LTRIM() and RTRIM() functions?

Manikanth Mani

Manikanth Mani

Updated on 06-Feb-2020 06:49:58

115 Views

For removing both leading and trailing spaces at once from a string by using LTRIM() and RTRIM() functions, we must have to use one function as an argument for other function. In other words, we must have to pass either LTRIM() function as an argument of RTIM() function or vice ... Read More

Advertisements