JAVA Forum

JAVA Forum

  • Submitted By: Roy12
  • Date Submitted: 04/12/2014 6:21 AM
  • Category: Technology
  • Words: 473
  • Page: 2
  • Views: 1

this Java Forum For Common problem which face by Developer And Learner please Feel Free to POST Them Here :

http://java-forum.freeforums.net/

We are great Full to Answer Them

Here Find the SOme Notes FOR JAVA


n almost all the interviews, they are asking String programs only,
So learn these methods one by one. If u’ve any doubt, comment ur doubts,
If u practice all the methods which I am posting then only, u can solve String based programs.
After learning all the methods, We’ll see, interview String based problems.
Pls practice all the methods, U'll understand easily.
I spent more time for preparing this.
If u've any doubts, Feel free to contact.
1. Use of equalsIgnoreCase(String anotherString) method
2. Use of indexOf(int ch) method
3. Use of indexOf(int ch, int fromIndex) method
4. Use of lastIndexOf(int ch) method
5. Use of lastIndexOf(int ch, int toIndex) method
6. Use of indexOf(String str) method
7. Use of indexOf(String str, int fromIndex) method
8. Use of lastIndexOf(String str) method
9. Use of lastIndexOf(String str, int toIndex) method
1. Use of equalsIgnoreCase(String anotherString) method
==============================================
Definition :
------------
equals() method is used for checking, whether both the String contents are same or not. If both String Objects are same means, it returns true, else returns false
equalsIgnoreCase() Compares this String to another String by ignoring case, whether both the String contents are same or not.
If both String Objects are same means, it returns true, else returns false.
Syntax : boolean equalsIgnoreCase(String anotherString)
Example 1:
--------------
String s1 = "HELLO TIGER";
String s2 = "HELLO TIGER";
String s3 = "Hello tiger";
boolean b1 = s1.equals(s2);
boolean b2 = s1.equals(s3);
boolean b3 = s2.equals(s3);
System.out.println("s1.equals(s2) : " + b1);
System.out.println("s1.equals(s3) : " + b2);
System.out.println("s2.equals(s3) : " + b3);...

Similar Essays