Here is the list of various categories of Simple Java programs.
1. Java Examples on Bitwise Operators
Bitwise operators is used to control the values of primitive data-types such as long, integer, short and byte. Bitwise xor operator gives results 1 for different value of bit and 0 for same value of bit, when a number is written in the binary form. Bits are smallest unit of data, bit has a single binary value 0 or 1. The following section contains programs on counting, multiplying and swapping the numbers using bitwise operators.
2. Java Examples on Recursion
Recursion is the process of defining something in terms of itself. Recursion is the attribute that allows a method to call itself. A method that calls itself is said to be recursive. Recursive functions are very helpful in solving mathematical problems. The following section displays a list of Java Programs which illustrate the concept of recursion. These programs include finding the sum of the digits of a number, finding the reverse of a number, finding the product and sum of 2 numbers. Programs which perform conversion of Binary code of a number into its equivalent Gray code with and without recursion. This section also contains program to print the binary equivalent of an integer.
3. Java Examples on Integers
Int is a primitive type. Int stores the actual binary value for the integer. Byte, short, int, and long are the integer types they are signed, positive and negative values. Java does not support unsigned and positive-only integers. The following section provides a list of Java programs which deals with an aspect of Basic Mathematics “Integers”. The given set of Programs depict if the given Integer is odd or even, positive or negative, finds the sum of odd and even integers, swaps the values of integers and computes the sum of digits of the given integer, reverse the given number, finds the biggest 3 integers and extract the digits from the given integers.
4. Java Examples on Number Conversion
The following section gives a list of Java programs on conversions like converting integer values into binary, days into years, long values into bytes, integer values into characters, english text to morse code and vice versa.
Java Program to Convert Integer Values into Binary
Java Program to Convert a Given Number of Days in Terms of Years, Weeks & Days
Java Program to Convert Integer Values into Byte, Character, Float
Java Program to Convert Long Values into Byte
Java Program to Convert English Text to Morse Code and Vice Versa
5. Java Examples to illustrate Functions of a Computer
The following section contains programs on usage of computer. Programs used to display the ip address of the system, shutdown the system in linux environment and checks whether authentication is done or not.
Java Program to Illustrate how User Authentication is Done
Java Program to Display the IP Address of the System
Java Program to Shutdown or Turn Off the Computer in Linux
6. Java Examples on Data Types
Java programming language is statically-typed, which means that all variables must be declared first before they can be used. Most commonly used data types in Java are int, char, float, double, String and boolean. Representing an integral number in binary format, that binary number has to be prefixed with 0b or 0B. The following section contains programs to check given character is vowel or consonant, performs binary addition of strings. The section also contains programs on character literals, binary literals and numeric literals.
Java Program to Check if a Given Character is Vowel or Consonant
Java Program to Check if given Alphabets are Uppercase or Lowercase or Digits
Java Program to Illustrate Use of Binary Literals
Java Program to Use Underscores in Numeric Literal
Java Program to Illustrate the Usage of Decimal Integer, Octal Integer, HexaDecimal, Floating, Character Literals
Java Program to Store Escape Sequence and Unicode Characters Using Character Literals
Java Program to Perform Binary Addition of Strings
7. Java Examples on Operators
Operator is a special type of symbol that is used to perform operations. Boolean operator operates on boolean values to create a new boolean value. Ternary operator is the simple one liner statement of an if-then-else statement. Relational operator compares two arithmetic expressions or two character expressions and evaluates to a single logical value. The following section contains programs on various operators like boolean operator, ternary operator, arithmetic operators, relational operators, pre and post increment and decrement operators.
8. Java Examples on Special Numbers
The following section provides a list of Java numbers used to display these special numbers and also perform various operations on these numbers. These operations include reversing a number, checking if the number is a palindrome, addition and multiplication of binary numbers, printing multiplication table for a given number, finding sum of the digits using do-while loop.
9. Java Examples on day-to-day Activities
Java programming skills can be applied to various activities in our day-to-day life. The following section is a list of Java programs to display ATM transactions, finding given year is a leap year or not and extracting last two digits in a given year.
Java Program to Extract Last two Digits of a given Year
Java Program to Find if a Given Year is a Leap Year
Java Program to Display the ATM Transaction
10. Java Examples on Methods, Objects and Switch Statements
Method is a collection of statements that perform some specific task. Method Overloading is a feature that allows a class to have more than one method having the same name, if their argument lists are different. Enum is a data type which contains fixed set of constants. Final keyword in a method declaration is to indicate that the method cannot be overridden by subclasses. Switch statement allows a variable to be tested for equality against a list of values. Each value is called a case. The following section contains programs on passing argument using method overloading, nesting of methods, enum concept, use of final keyword, switch statements using strings, passing objects and type casting.
11. Java Examples on Special Programs
The following section contains programs on printing a semicolon without using a semicolon, taking the height of a person as the input and categorizing it as Taller, Dwarf and Average, dot representation of a graph and automatic generation of essays.
Java Program to Print a Semicolon without Using a Semicolon Anywhere in the Code
Java Program to Print any Statement without Using Semicolon
Java Program to Accept the Height of a Person & Categorize as Taller, Dwarf & Average
Java Program to Generate a DOT Representation of a Graph
Java Program to Automatically Generate Essays for You