Monday 14, Apr 2025
We are moved to new domain
Click -> www.ehowtonow.com
Sunday, 3 May 2015

How to convert a String to Upper case

Following example shows how to convert a string to upper case.

Sample Program

package com.javatutorialcorner.javastring;

public class ToUpperCase {

public static void main(String[] args) {
String input = "Java tutorials corner contains tutorials for Java programers day to day needs tutorials like Java, Spring, Hibernate, String, JSON, Jackson, GSON, XML parsing, Web Service, SOAP Web Service, RESTful Web Service";
String upperCase = input.toUpperCase();

System.out.println("Input String : " + input);
System.out.println("Upper case String : " + upperCase);

}

}


Output


The above code will produce the following out



Input String : Java tutorials corner contains tutorials for Java programers day to day needs tutorials like Java, Spring, Hibernate, String, JSON, Jackson, GSON, XML parsing, Web Service, SOAP Web Service, RESTful Web Service
Upper case String : JAVA TUTORIALS CORNER CONTAINS TUTORIALS FOR JAVA PROGRAMERS DAY TO DAY NEEDS TUTORIALS LIKE JAVA, SPRING, HIBERNATE, STRING, JSON, JACKSON, GSON, XML PARSING, WEB SERVICE, SOAP WEB SERVICE, RESTFUL WEB SERVICE

Shop and help us

Flipkart Offer Snapdeal offer Amazon.in offer Amazon.com offer

Related Posts:

  • Comparing StAX with other XML parsers In this tutorial we are going to see about Pull Vs Push parsing and comparing StAX with other XML parsing API like SAX, DOM, TrAX. This tutorial created by refer Oracle StAX documentation. Pull Parsing versus Push Parsing… Read More
  • How to compare paths of two file using Java Following example shows how to compare paths of two file using file1.compareTo() method in Java. compareTo public int compareTo(File pathname)  Compares two abstract pathnames lexicographically. The ordering defined by… Read More
  • How to get file size using Java Following example shows how to get file size in bytes using file.length() method in Java. lengthpublic long length() Returns the length of the file denoted by this abstract pathname. The return value is unspecified if this … Read More
  • How to rename the file using Java Following example shows how to rename the file using file.renameTo() method in Java. renameTo public boolean renameTo(File dest)  Renames the file denoted by this abstract pathname. Many aspects of the behavior of this… Read More
  • Java 8 – Overview and New Features Java 8 (Java SE 8) is a major feature release.With Java 8 release, java provided support for Functional Programming JavaScript Engine API for Date and Time Streaming API, etc.., New Features in Java 8 Some important featu… Read More
  • Blogger Comments
  • Facebook Comments
  • Disqus Comments

0 comments:

Post a Comment

Item Reviewed: How to convert a String to Upper case Rating: 5 Reviewed By: eHowToNow