techhipbettruvabetnorabahisbahis forumutaraftarium24edusedueduseduseduedusedueduedusedus Java Program : Convert Lowercase Character to Uppercase in Java
Latest :

Java Program : Convert Lowercase Character to Uppercase in Java

Java Program to Convert lowercase character to uppercase character, the following program has written in different ways to convert small alphabets to capital alphabets. Sample output is also added after the Java program, Java String toLowercase() and toUpperCase().

Our problem statement here is, to convert all the lowercase character of the given input into uppercase. To do this, we require an input string and our expected output is the string where there are no lowercase and everything is converted to uppercase.

To read the input string, we make use of a well known class in Java named, the Scanner class.

This helps us to read inputs from console screen of any primitive datatype at runtime. For this, we first create an object of this class and using the object we invoke the nextLine() method. We invoke the nextLine() method because, our required output is of string type.

This can be done as shown below:

To convert lowercase to uppercase, we need to check individual characters of the string. To do this, we first convert the string into character array by making use of the String.charAt() method. This is stored in the character array (ch).

Every character has ASCII values by which it is stored. The ASCII value of lowercase i.e., from ‘a’-‘z’ is 97-122 whereas, the ASCII value of upper case i.e., from ‘A’-‘Z’ is 65-90.

Therefore, to convert every lowercase alphabet to its corresponding uppercase alphabet, we need to subtract 32 from the lowercase alphabet.

So, we traverse through the character array until the end and check whether the character at that index is between 97-122 both inclusive.

If it is in that range then, 32 is subtracted from it. Now, when we reach the end of the character array and exit the loop, all the alphabets become uppercase only.

This can then be displayed in the console screen using the System.out.println() method. After this, our code execution comes to an end.

for(i=0;i<s1.length();i++) {

if(ch[i]>=97 && ch[i]<=122 ) {

ch[i]-=32;

}

}

System.out.println(ch);

Java Code – Lowercase to Uppercase Character

Output:

techhipbettruvabetnorabahisbahis forumutaraftarium24edueduedueduedueduseduseduseduedu
x

Check Also

Java Program To Reverse An Array | Programs

Java program to reverse an array – We will discuss the various methods to reverse ...

grandpashabetgrandpashabetgrandpashabethttps://mobilebarhawaii.com/ballettea tropazcasibom girişcasibomhacklinkgrandpashabetbets10onwinonwin girişgrandpashabetholiganbetatakoy escortatakoy escortsisli escortjojobetCasibomtürk pornomavibet girişcratosroyalbetdeneme bonusu veren sitelergrandpashabetonwinligobetgonabetJojobetsahabethttps://www.escortbayanlariz.net/betwoonsahabetcasibomcasibom girişEskişehir escortjojobetbakırköy escortdeneme bonusu veren sitelerhalkali escortgrandpashabet girişholiganbet güncel girişankara escort bayancasino siteleriultrabetgrandpashabet girişholiganbetonwinholiganbetgrandpashabetesenyurt anal escortPadişahbetnakitbahiscasibom girişgrandpashabetİstanbul Escorthttps://www.gvscolombia.com/betebetdeneme bonusu veren sitelerJojobet GirişstarzbetsavoybettingsavoybettingjojobetfixbetBetturkey girişcasibom güncel girişkucukcekmece escortholiganbetimajbetkingroyalmadridbetmatbetmavibetmeritbetmeritkingonwinotobetmeritbetimajbetcasibomsekabetbetvolebetordercasinolevantArtemisbetmadridbetmavibetmeritking girişotobetjojobetholiganbetholiganbet girişonwincasibom girişcasibom girişsahabet girişmadridbetbetturkey girişmarsbahis giriş güncelsahabet güncel giriştipobetistanbul escortscanlı bahisstarzbetultrabetjojobetenbetvbettrromabetcasibom girişcasibomcasibom güncel girişjojobetmegabahisjojobet girişmarsbahiszbahisperabetbakırköy escortdeneme bonusu veren sitelerbetebet güncel girişdumanbetsightcarebilyoneronwinonwinsahabetbets10,bets10 giriş,bets10 güncel giriştipobetmarsbahis,marsbahis güncel giriş , marsbahis giriş,marsbahis adresmarsbahis,marsbahis güncel giriş , marsbahis giriş,marsbahis adressekabetpradabettarafbetmilanobetmilanobetpusulabettempobetpusulabettempobetpusulabetjojobetbets10madridbetBostancı escort Bağcılar escortmatbetjojobet,jojobet girişsekabet girişjojobet,jojobet girişjojobetizmir escortcasibomtipobetjasminbetİstanbul Escortbahis sitelericasibomjojobet girişJojobet Girişankara escortzbahiszbahis girişzbahis güncel girişholiganbetcasibomsonbahisdeneme bonusu veren siteler 2025vaycasinocasinomaxizbahisotobet girişimajbetcasibomvaycasinojojobetbetturkeymarsbahis girişmatbet girişmarsbahisbetturkeybetexperdeneme bonusu veren sitelermariobetwinxbetbetexperbetofficegonebetgrandpashabetgrandpashabet güncelpusulabetpusulabetcasibom girişonwin,onwin giriş,onwin güncel giriş,onwin giriş adresitipobetbetebetmarsbahisultrabetholiganbetjojobetfixbetkulisbetnakitbahispinbahisrestbettipobettrendbetultrabetjojobetholiganbetotobetbetexperpusulabetasyabahisparibahiskulisbettipobetHoliganbet girişfixbetvaycasinojojobet,jojobet girişonwinhttps://sahipleniyorum.com/jojobetjojobet girişultrabetmatbetcasibomcasibom girişmaltepe escortextrabet girişmecidiyeköy escortsekabet girişjojobettipobetbetturkeygonabettipobetcasibom girişmavibetmavibet girişmaltcasinomaltcasino girişmavibet güncelJojobet girişMAVİBETİMAJBETextrabetzbahismarsbahisbahis forumcasibom giriştakipçi hilesivaycasinocashback girişjojobetgonebetjojobetjojobetgüncel girişcasinoroyalcasibom