Thursday 25 February 2016

Java Tutorial : Java wrapper class (Character class methods)


Click here to watch in Youtube :
https://www.youtube.com/watch?v=-Y2au3fZtp4&list=UUhwKlOVR041tngjerWxVccw

Click the below Image to Enlarge
Java Tutorial : Java wrapper class (Character class methods)
WrapperClassTest.java
public class WrapperClassTest
{

    public static void main(String[] args)
    {
        /*
         * Determines whether the specified char value is a
         * letter.
         */
        boolean isLetter = Character.isLetter('a');
        System.out.println("Character.isLetter('a') = " + isLetter);

        /*
         * Determines whether the specified char value is a
         * digit.
         */
        boolean isDigit = Character.isDigit('2');
        System.out.println("Character.isDigit('2')  = " + isDigit);

        /*
         * Determines whether the specified char value is
         * white space.
         */
        boolean isWhiteSpace = Character.isWhitespace(' ');
        System.out.println("Character.isWhitespace(' ')  = "
                + isWhiteSpace);

        /*
         * Determines whether the specified char value is
         * uppercase.
         */
        boolean isUpperCase = Character.isUpperCase('A');
        System.out.println("Character.isUpperCase('A')  = "
                + isUpperCase);

        /*
         * 
         * Determines whether the specified char value is
         * lowercase.
         */
        boolean isLowerCase = Character.isLowerCase('a');
        System.out.println("Character.isLowerCase('a')  = "
                + isLowerCase);

        /*
         * Returns the uppercase form of the specified char
         * value.
         */
        System.out.println("Character.toUpperCase('m') = "
                + Character.toUpperCase('m'));

        /*
         * Returns the lowercase form of the specified char
         * value.
         */
        System.out.println("Character.toLowerCase('B') = "
                + Character.toLowerCase('B'));

        /*
         * Returns a String object representing the
         * specified character value — that is, a
         * one-character string.
         */
        String str = Character.toString('u');
        System.out.println("Character.toString('u') = " + str);

    }

}
Output
Character.isLetter('a') = true
Character.isDigit('2')  = true
Character.isWhitespace(' ')  = true
Character.isUpperCase('A')  = true
Character.isLowerCase('a')  = true
Character.toUpperCase('m') = M
Character.toLowerCase('B') = b
Character.toString('u') = u
Refer: 
https://docs.oracle.com/javase/8/docs/api/index.html?java/lang/Character.html

Click the below link to download the code:
https://sites.google.com/site/javaee4321/java/WrapperClassDemo_Character_methods_App.zip?attredirects=0&d=1

Github Link:
https://github.com/ramram43210/Java/tree/master/BasicJava/WrapperClassDemo_Character_methods_App

Bitbucket Link:
https://bitbucket.org/ramram43210/java/src/f04fb0b510d935a99056b97ab2ac51f619fac410/BasicJava/WrapperClassDemo_Character_methods_App/?at=master

See also:

  • All JavaEE Viedos Playlist
  • All JavaEE Viedos
  • All JAVA EE Links
  • Servlets Tutorial
  • All Design Patterns Links
  • JDBC Tutorial
  • Java Collection Framework Tutorial
  • JAVA Tutorial
  • No comments:

    Post a Comment