

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Java Program to check whether the entered value is ASCII 7 bit alphabetic
<p>To check whether the entered value is ASCII 7-bit alphabetic, check the character from ‘a’ to ‘z’ or ‘A’ to ‘Z’.</p><p>Here, we have a character.</p><pre class="result notranslate">char one = 'r';</pre><p>Now, we have checked a condition with if-else to check for character from ‘a’ to ‘z’ or ‘A’ to ‘Z’.</p><pre class="prettyprint notranslate">if ((one >= 'A' && one <= 'Z') || (one >= 'a' && one <= 'z')) { System.out.println("Given value is an alphabet!"); } else { System.out.println("Given value is not an alphabet!"); }</pre><h2>Example</h2><p><a class="demo" href="http://tpcg.io/dquPDk" rel="nofollow" target="_blank"> Live Demo</a></p><pre class="prettyprint notranslate" style="margin-left: 20px;">public class Demo { public static void main(String []args) { char one = 'r'; System.out.println("Character: "+one); if ((one >= 'A' && one <= 'Z') || (one >= 'a' && one <= 'z')) { System.out.println("Given value is an alphabet!"); } else { System.out.println("Given value is not an alphabet!"); } } }</pre><h2>Output</h2><pre class="result notranslate">Character: r Given value is an alphabet!</pre><p>Let us see another example</p><h2>Example</h2><p><a class="demo" href="http://tpcg.io/WKjNJz" rel="nofollow" target="_blank"> Live Demo</a></p><pre class="prettyprint notranslate">public class Demo { public static void main(String []args) { char one = '1'; System.out.println("Character: "+one); if ((one >= 'A' && one <= 'Z') || (one >= 'a' && one <= 'z')) { System.out.println("Given value is an alphabet!"); } else { System.out.println("Given value is not an alphabet!"); } } }</pre><h2>Output</h2><pre class="result notranslate">Character: 1 Given value is not an alphabet!</pre>
- Related Questions & Answers
- Java Program to check whether the entered value is ASCII 7-bit alphabetic lowercase
- Java Program to check whether the entered value is ASCII 7 bit alphabetic uppercase
- Java Program to check whether the entered value is ASCII 7-bit control character
- Java Program to check whether the entered character is ASCII 7 bit numeric and character
- Java Program to check whether the character is ASCII 7 bit
- Java Program to check whether the character is ASCII 7 bit numeric
- Java Program to check whether the character is ASCII 7 bit printable
- Check whether the entered value is whitespace or not in Java
- Check whether the entered value is a digit or not in Java
- Check whether the entered value is a letter or not in Java
- C# Program to Check Whether the Entered Number is an Armstrong Number or Not
- 8085 program to add even parity to a string of 7 bit ASCII characters.
- 8085 program to check whether the given 16 bit number is palindrome or not
- Java Program to Check Whether the Given String is Pangram
- Java Program to check whether the entered character a digit, white space, lower case or upper case character
Advertisements