انت هنا الان : شبكة جامعة بابل > موقع الكلية > نظام التعليم الالكتروني > مشاهدة المحاضرة

Java Characters:

الكلية كلية تكنولوجيا المعلومات     القسم قسم البرامجيات     المرحلة 2
أستاذ المادة احمد مهدي محمد سعيد الصالح       31/01/2016 20:14:07
Java Characters:
Normally, when we work with characters, we use primitive data types char.
Example:
char ch = a ;
Character Methods:
• isLetter( ) Determines whether the specified char value is a letter.
• isDigit( ) Determines whether the specified char value is a digit.
• isWhitespace( ) Determines whether the specified char value is white space.
• isUpperCase( ) Determines whether the specified char value is uppercase.
• isLowerCase( ) Determines whether the specified char value is lowercase.
• toUpperCase( ) Returns the uppercase form of the specified char value.
• toLowerCase( ) Returns the lowercase form of the specified char value.
• toString( ) Returns a String object representing the specified character value that is, a one-character string.

All these Methods call after character.Method
public class Test {
public static void main(String args[]) {
System.out.println(Character.isLetter( c ));
System.out.println(Character.isLetter( 5 ));
}
}
This produces the following result:
true
false

public class Test {
public static void main(String args[]) {
System.out.println(Character.isDigit( c ));
System.out.println(Character.isDigit( 5 ));
}
}
This produces the following result:
false
true



public class Test{
public static void main(String args[]){
System.out.println(Character.isWhitespace( c ));
System.out.println(Character.isWhitespace( ));
System.out.println(Character.isWhitespace( \n ));
System.out.println(Character.isWhitespace( \t ));
}
}
This produces the following result:
false
true
true
true


public class Test{
public static void main(String args[]){
System.out.println( Character.isUpperCase( c ));
System.out.println( Character.isUpperCase( C ));
System.out.println( Character.isUpperCase( \n ));
System.out.println( Character.isUpperCase( \t ));
}
}
This produces the following result:
false
true
false
false

public class Test{
public static void main(String args[]){
System.out.println(Character.isLowerCase( c ));
System.out.println(Character.isLowerCase( C ));
System.out.println(Character.isLowerCase( \n ));
System.out.println(Character.isLowerCase( \t ));
}
}
This produces the following result:
true
false
false
false


المادة المعروضة اعلاه هي مدخل الى المحاضرة المرفوعة بواسطة استاذ(ة) المادة . وقد تبدو لك غير متكاملة . حيث يضع استاذ المادة في بعض الاحيان فقط الجزء الاول من المحاضرة من اجل الاطلاع على ما ستقوم بتحميله لاحقا . في نظام التعليم الالكتروني نوفر هذه الخدمة لكي نبقيك على اطلاع حول محتوى الملف الذي ستقوم بتحميله .