Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Uppercase string

807601Apr 5 2008 — edited Apr 5 2008
Hey guys, I'm very new to java.
I'm running into a problem while trying to create a string that changes to uppercase when using the .toUppercase method.

This is my code:

import java.util.Scanner;
public class StringMutations {

public static void main(String[] args)
{
Scanner sc;
String test;

sc = new Scanner(System.in);
System.out.print("Enter string: ");
test = sc.nextLine();

test = test.toUppercase();
System.out.println(test);
}
}

If someone could help me out it would be MUCH appreciated.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 3 2008
Added on Apr 5 2008
2 comments
149 views