Skip to main content

Posts

ASCII Code in Java (Part 2)

> The ASCII Code: (Part 2) Printing the ASCII code for a character: Printing the character based on the ASCII code input (Reverse of the previous program): Printing the ASCII code every character in an input String: Click HERE for ASCII Code Information (Part 1) Click HERE for the Methods of Character class.

ASCII Code in Java (Part 1)

> The ASCII Code: (Part 1) ASCII stands for "American Standard Code for Information Interchange". As you may remember (Grade 9), computers only work with HIGH(1) and LOW(0) electrical states, known as bits, with correspond to mathematical Base 2 numbers. That is, computers only understand binary language. ASCII codes represent text (or other things) in computers. Assume that you are working with MS Word, or PPT or any other tool that uses text based inputs from user. You need to type a sentence that computer is not aware of. ASCII codes help to exchange this information between user and computer. When you type a character, it is converted into ASCII code first and then into Binary, which makes the computer understand what is to be typed. Hence every key on the keyboard has a specific ASCII code which is used to make the computer understand our language. If you press 4 from keyboard, then keyboard send the value 100 (value equival...

Character class in Java (Part 1)

> The Character Class: (Part 1) A character data type represents a single character. The character data type, char, is used to represent a single character. A character literal is enclosed in single quotation marks. For example: (char literals) char letter = 'A'; char numChar = '4'; Here, the first statement assigns character A to the char variable letter. The second statement assigns digit character 4 to the char variable numChar. NOTE: A string literal must be enclosed in quotation marks (" "). A character literal is a single character enclosed in single quotation marks (' '). Therefore, "A" is a string, but 'A' is a character. Also, a string is a combination of one or more characters. We can also see Strings as "A Sequence of Characters". Every key on the keyboard has a specific integer value. It is known as the ASCII code. See HERE for more information. Methods of Character class:...

Arrays in Java (Part 6)

> Arrays in Java: (Part 6) One Dimensional Array : 7. Linear Search in Java (for integers) 8. Linear Search in Java (for Strings) 9. Print the strings that ends with a vowel from an array of strings Example: (Linear Search in Java -> for Integers) Example: Linear Search in Java (for Strings) Example: (Linear Search - find all the possible locations of the key entered by user)

Arrays in Java (Part 5)

> Arrays in Java: (Part 5) One Dimensional Array : 4. Print the strings that are of even length from an array of strings 5. Print the strings that start with a vowel from an array of strings 6. Print the strings that ends with a vowel from an array of strings Example: (Print the strings that are of even length) Example: (Print the strings that start with a vowel) Example: (Print the strings that end with a vowel)

Arrays in Java (Part 4)

> Arrays in Java: (Part 4) One Dimensional Array : 1. Sum all elements of integer array 2. Find maximum and minimum element 3. Find the longest string (largest length string) Example: (Sum all elements of integer array) Example: (Find maximum and minimum element from integer array) Example: (Find longest string in a string array in java)

Arrays in Java (Part 3)

> Arrays in Java: (Part 3) One Dimensional Array (Accepting array and printing programs): Example: (Print static array (int) in Java) Example: (Print Dynamic array (int) in Java) Example: (Print static array (String) in Java) Example: (Print dynamic array (String) in Java)

Relevant to YOU: