This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Help me put this into a method.. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Help me put this into a method.." Watch "Help me put this into a method.." New topic

Help me put this into a method..

mike bones

Joined: Mar 24, 2007
Posts: 4

I'm a new java programmer trying to convert this prog into a method. What the prog does is converts a string to uppercase.


public class CaseChange
public static void main (String[] args)
String TestString = new String("Test String");

TestString = TestString.toUpperCase();
System.out.println("UPPER CASE " + TestString);


Can anyone help me convert this into a method? So that I can call it in the main?

Any help would be great.

pete stein

Joined: Feb 23, 2007
Posts: 1561
I'm not exactly sure what you want as I think that there are several ways to do what I think you desire.

using static methods:

or using classes:

ps: please learn about code tags so that your code is more readable.
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link:
subject: Help me put this into a method..
It's not a secret anymore!