![Trending Articles on Technical and Non Technical topics](/images/trending_categories.jpeg)
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 9326 Articles for Object Oriented Programming
![Pythonista](https://www.tutorialspoint.com/assets/profiles/15003/profile/60_128639-1514576467.png)
324 Views
It is a bitwise right shift operator. The bit pattern is shifted towards right by number of places stipulated by operand on right. Bits on left are set to 0For example a=60 (00111100 in binary), a>>2 will result in 15 (00001111 in binary)>>> a=60 >>> bin(a)result #39;0b111100' >>> b=a>>2 >>> bin(b) '0b1111'
![Sravani S](https://www.tutorialspoint.com/assets/profiles/13538/profile/60_67753-1512711355.jpg)
1K+ Views
Java lang package provides Integer class which has methods to convert an integer to String and vice versa. You can convert a String to an integer using the parseInt() method and Integer to String using the toString() method.ExampleLive Demopublic class Sample { public static void main(String args[]){ String str = "1212"; int num = Integer.parseInt(str); System.out.println(num); String st = Integer.toString(num); System.out.println(); } }Output1212
![V Jyothi](https://www.tutorialspoint.com/assets/profiles/13530/profile/60_77592-1512648869.jpg)
203 Views
Java lang package provides a Double class which has methods to convert Double to String and vice versa. You can convert a String to a double using the parseDouble() method and double to String using the toString() methodExampleLive Demopublic class StringDouble { public static void main(String args[]){ Double data1 = 2.2; String str = Double.toString(data1); System.out.println(str); Double data2 = Double.parseDouble(str); System.out.println(data2); } }Output2.2 2.2
![Priya Pallavi](https://www.tutorialspoint.com/assets/profiles/13562/profile/60_91320-1512544134.jpg)
142 Views
Java String class provides several variants of valueOf() method. These accept various data types and convert them into String.ExampleLive Demopublic class Sample { public static void main(String args[]){ int i = 200; float f = 12.0f; char c = 's'; char[] ch = {'h', 'e', 'l', 'l', 'o'}; String data = String.valueOf(i); System.out.println(String.valueOf(i)); System.out.println(String.valueOf(f)); System.out.println(String.valueOf(c)); System.out.println(String.valueOf(ch)); } }Output200 12.0 s hello
![Nikitha N](https://www.tutorialspoint.com/assets/profiles/13558/profile/60_76068-1512713229.jpg)
1K+ Views
The toString() method of the String class returns itself a string.ExampleLive Demoimport java.io.*; public class Test { public static void main(String args[]) { String Str = new String("Welcome to Tutorialspoint.com"); System.out.print("Return Value :"); System.out.println(Str.toString()); } }OutputReturn Value :Welcome to Tutorialspoint.comThe value of method variants of the String class accepts different variables such as integer, float, boolean etc.. and converts them into String.ExampleLive Demopublic class Sample { public static void main(String args[]){ int i = 200; float f = 12.0f; ... Read More
![Abhinanda Shri](https://www.tutorialspoint.com/assets/profiles/13552/profile/60_73264-1512711555.jpg)
77 Views
You can change the cases using the toUpperCase() and toLowerCase() methods of the String class.ExampleLive Demopublic class Sample { public static void main(String args[]){ String str = "Hello how are you"; String strUpper = str.toUpperCase(); System.out.println("Lower to upper : "+strUpper); String strLower = str.toLowerCase(); System.out.println("Upper to lower : "+strLower); } }OutputLower to upper : HELLO HOW ARE YOU Upper to lower : hello how are you
![Ankitha Reddy](https://www.tutorialspoint.com/assets/profiles/13550/profile/60_73963-1512711511.jpg)
899 Views
The toUpperCase() method converts all of the characters in this String to upper case using the rules of the default locale The toLowerCase() method converts all of the characters in this String to lower case using the rules of the default locale. Example Live Demo import java.lang.*; public class StringDemo { public static void main(String[] args) { // converts all upper case letters in to lower case letters String str1 = "SELF LEARNING CENTER"; System.out.println("string value = ... Read More
![Srinivas Gorla](https://www.tutorialspoint.com/assets/profiles/13556/profile/60_78057-1512712331.jpg)
846 Views
ExampleLive Demoimport java.lang.*; public class StringDemo { public static void main(String[] args) { // converts all upper case letters in to lower case letters String str1 = "SELF LEARNING CENTER"; System.out.println("string value = " + str1.toLowerCase()); str1 = "TUTORIALS POINT"; System.out.println("string value = " + str1.toLowerCase()); // converts all lower case letters in to upper case letters String str2 = "This is TutorialsPoint"; System.out.println("string value = " + str2.toUpperCase()); str2 = "www.tutorialspoint.com"; System.out.println("string value = " + str2.toUpperCase()); } } Outputstring value = self learning center string value = tutorials point string value = THIS IS TUTORIALSPOINT string value = WWW.TUTORIALSPOINT.COM
![Ramu Prasad](https://www.tutorialspoint.com/assets/profiles/13539/profile/60_87996-1512650215.jpg)
179 Views
This method has two variants. The first variant converts all of the characters in this String to upper case using the rules of the given Locale. This is equivalent to calling toUpperCase(Locale.getDefault()).The second variant takes a locale as an argument to be used while converting into upper case.ExampleLive Demoimport java.io.*; public class Test { public static void main(String args[]) { String Str = new String("Welcome to Tutorialspoint.com"); System.out.print("Return Value :"); System.out.println(Str.toUpperCase()); } }OutputReturn Value :WELCOME TO TUTORIALSPOINT.COM
![Sravani S](https://www.tutorialspoint.com/assets/profiles/13538/profile/60_67753-1512711355.jpg)
279 Views
The split(String regex) method of the String class splits this string around matches of the given regular expression.ExampleLive Demopublic class Sample{ public static void main(String args[]){ String s = "|A|BB||CCC|||"; String[] words = s.split("\|"); for (String string : words) { System.out.println(string); } } }OutputA BB CCC