ToupperCase() Method అంటే ఏమిటి?
ఉదాహరణ
జావాలో toUpperCase() పద్ధతిని ఉపయోగించి స్ట్రింగ్ను ALL-CAPSకి మార్చడానికి ప్రాథమిక ఉదాహరణను చూద్దాం .
public class UpperCase {
public static void main(String[] args) {
String myCountry = "pakistan";
System.out.println("My Country name is: " + myCountry);
// convert a string to uppercase
System.out.println("My Country name using toUpperCase() is: " + myCountry.toUpperCase() + "\n");
String paragraph = "Code Gym is an amazing place to start your java learning journey!";
System.out.println("Text paragraph: " + paragraph);
// convert a paragraph to uppercase
System.out.println("Text paragraph after using toUpperCase() method: " + paragraph.toUpperCase() + "\n");
char dummyChar = 'a';
System.out.println("dummyChar is: " + dummyChar);
// convert the primitive 'char' type to uppercase
System.out.println("dummyChar using toUpperCase() is: " + Character.toUpperCase(dummyChar));
}
}
అవుట్పుట్
నా దేశం పేరు: pakistan ToUpperCase()ని ఉపయోగిస్తున్న నా దేశం పేరు: పాకిస్థాన్ టెక్స్ట్ పేరా: కోడ్ జిమ్ మీ జావా అభ్యాస ప్రయాణాన్ని ప్రారంభించడానికి అద్భుతమైన ప్రదేశం! ToUpperCase() పద్ధతిని ఉపయోగించిన తర్వాత టెక్స్ట్ పేరా: కోడ్ జిమ్ అనేది మీ జావా లెర్నింగ్ జర్నీని ప్రారంభించడానికి అద్భుతమైన ప్రదేశం! డమ్మీచార్: టుఅప్పర్కేస్()ని ఉపయోగించే డమ్మీచార్: ఎ
GO TO FULL VERSION