4 Replies - 382 Views - Last Post: 27 January 2013 - 07:28 AM Rate Topic: -----

#1 magicm00n  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 114
  • Joined: 01-March 12

[HELP] Converting letter from lowercase to uppercase

Posted 27 January 2013 - 06:39 AM

There is one error with my code. can someone pls explain?
import javax.swing.JOptionPane;
 public class LowerCasetoUpperCase {
  public static void main(String[] args) {
   //Enter a lowercase letter
   String LowerCaseString=JOptionPane.showInputDialog("Enter a lowercase letter: ");
   
   //Convert lowercase to uppercase
    char UpperCase=String.toUpperCase(LowerCaseString);
   
    //Display results
    String output="The Uppercase letter is "+UpperCase+" ";
    JOptionPane.showMessageDialog(null, output);
 }
}


Is This A Good Question/Topic? 0
  • +

Replies To: [HELP] Converting letter from lowercase to uppercase

#2 andrewsw  Icon User is offline

  • Fire giant boob nipple gun!
  • member icon

Reputation: 3316
  • View blog
  • Posts: 11,188
  • Joined: 12-December 12

Re: [HELP] Converting letter from lowercase to uppercase

Posted 27 January 2013 - 07:14 AM

String UpperCase = LowerCaseString.toUpperCase();


toUpperCase() is not a static member of String.
Was This Post Helpful? 1
  • +
  • -

#3 magicm00n  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 114
  • Joined: 01-March 12

Re: [HELP] Converting letter from lowercase to uppercase

Posted 27 January 2013 - 07:21 AM

How can I fix that?
Was This Post Helpful? 0
  • +
  • -

#4 andrewsw  Icon User is offline

  • Fire giant boob nipple gun!
  • member icon

Reputation: 3316
  • View blog
  • Posts: 11,188
  • Joined: 12-December 12

Re: [HELP] Converting letter from lowercase to uppercase

Posted 27 January 2013 - 07:22 AM

View Postmagicm00n, on 27 January 2013 - 07:21 AM, said:

How can I fix that?


I've already given you the code.
Was This Post Helpful? 0
  • +
  • -

#5 magicm00n  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 114
  • Joined: 01-March 12

Re: [HELP] Converting letter from lowercase to uppercase

Posted 27 January 2013 - 07:28 AM

Oh my bad didn't notice it :D

Thank you!!
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1