pract4
pract4
The java string toUpperCase() method returns the string in uppercase le er. In other words, it
converts all characters of the string into upper case le er.
Internal implementa on
2. if (locale == null) {
4. }
5.
6. int firstLower;
8.
10. scan: {
16. c = codePointAt(firstLower);
18. } else {
19. srcCount = 1;
20. }
23. || (c != upperCaseChar)) {
25. }
26. firstLower += srcCount;
27. }
29. }
30.
34.
37.
51. } else {
52. srcCount = 1;
53. }
54. if (localeDependent) {
56. } else {
57. upperChar = Character.toUpperCaseEx(srcChar);
58. }
62. if (localeDependent) {
63. upperCharArray =
65. } else {
67. }
71. } else {
73. }
74.
81. }
84. }
86. } else {
89. }
91. }
Signature
There are two variant of toUpperCase() method. The signature or syntax of string toUpperCase()
method is given below:
The second method variant of toUpperCase(), converts all the characters into uppercase using the
rules of given Locale.
Returns
4. String s1upper=s1.toUpperCase();
5. System.out.println(s1upper);
6. }}
Test it Now
Output:
HELLO STRING
8. System.out.println(english);
9. }
10. }
Output:
HELLO STR?NG
HELLO STRING