I have two problem. Please try to solve...
No 1. Suppose I have two string:-
String one = "Android is awesome";
String two = "Android is";
Now my question is, can I get awesome by comparing those two string like we do with int.
int abc = 50;
int def = 35;
int ghi = abc - def;
output :-
ghi = 15;
So, this is what we do basically with int, long, double... Is it possible also with String?
No 2. Now, suppose again I have a string-array
ArrayList<String> list = new Arraylist()<>;
list.add("beautiful");
list.add("awesome");
list.add("cool");
Now, if string-comparing is possible, then suppose I have got a new String three from comparing one and two.
So, here,
String three = "awesome";
Now, again, I am using if-statement
if(list.contains("awesome")){
**Problem here starts. See the commented texts**
//Here if **awesome** is found in **list**, so can I get the position of **awesome** in the **list**?
}
Forgive me for a big and rough question. Please help me. I am really so sad with this problem.
indexOfmethod ofArrayListdocs.oracle.com/javase/7/docs/api/java/util/…