| | |
Changing uppercase letter to lower case
Please support our Java advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Nov 2004
Posts: 3
Reputation:
Solved Threads: 0
I need to write a JAVA program that converts an uppercase letter to a lowercase letter ... the method declaration should be
public static char upperCasetoLowerCase(char ch) ... I think I am missing something in my thought process. Can anyone help? Here is what I have tried...
When I try and execute this I get a message that says Exception in thread "main" java.lang.nosuchmethoderror:main I really have no clue what this means
public static char upperCasetoLowerCase(char ch) ... I think I am missing something in my thought process. Can anyone help? Here is what I have tried...
Java Syntax (Toggle Plain Text)
public static char upperCaseToLowerCase(char ch) { System.out.println("Enter an Uppercase letter"); char upper =MyInput.readChar(); System.out.println("the lower case is" + upper); }
When I try and execute this I get a message that says Exception in thread "main" java.lang.nosuchmethoderror:main I really have no clue what this means
Last edited by alc6379; Nov 2nd, 2004 at 4:02 pm. Reason: added [code] tags
Basically, every java program must be written within a class. The method above does not seem to be within a class (by the same filename.java) In addition, a program must always start from within public static void main(String[] args) { ... } From inside the main method, you can call other methods, such as upperCaseToLowerCase(char). However, there must always be a main method to start out from.
Put the following, with slight modifications, into a file called switchCase.java
Put the following, with slight modifications, into a file called switchCase.java
Java Syntax (Toggle Plain Text)
public class switchCase { public static char upperCaseToLowerCase(char ch) { char lowerch; lowerch = // lowercase version of ch return lowerch; } public static void main(String[] args) { System.out.println("Enter an Uppercase letter"); char upper =MyInput.readChar(); System.out.println("Upper case = " + upper); System.out.println("Lower case = " + upperCaseToLowerCase(upper)); } }
Dani the Computer Science Gal 
Follow my Twitter feed! twitter.com/DaniWeb
And if you're interested in Internet marketing there is twitter.com/DaniWebAds

Follow my Twitter feed! twitter.com/DaniWeb
And if you're interested in Internet marketing there is twitter.com/DaniWebAds
![]() |
Similar Threads
- How i could check my password (PHP)
- Assembly vs. C++ Performance (Assembly)
- convert lower case letters to uppercase and vice-versa (C++)
- Converting from lower case and uppercase (C)
- convert uppercase into lower case (Assembly)
Other Threads in the Java Forum
- Previous Thread: Would like for someone to check this to see if works and any help if it does not
- Next Thread: Please explain debugging
| Thread Tools | Search this Thread |
Tag cloud for Java
actuate android api apple applet application arguments array arrays automation banking binary bluetooth character chat class classes client code component constructor crashcourse database design developmenthelp draw eclipse error event exception file fractal game givemetehcodez graphics gui helpwithhomework html ide if_statement image input integer interface j2me java javaarraylist javadoc javaee javamicroeditionuseofmotionsensor javaprojects jetbrains jmf jni jpanel julia linux list loop map method methods mobile multithreading netbeans newbie number oracle pearl print printing problem program programming project property recursion remove scanner screen server set size sms socket software sort splash sql stop string swing test textfield thread threads time tree validation windows






