Programmr's Live Examples
What better way to learn programming concepts than to tinker with interactive examples right in your browser?
Java
- Simple Pattern Matching Demo
- Use find() to Find a Subsequence
- Use find() to Find Multiple Subsequences
- Use a quantifier.
- Use Wildcard and Quantifier.
- Use the ? quantifier.
- Use a Character Class
- Use replaceAll()
- Use split().
- Demonstrate Reflection.
- Show public methods.
- Remote Interface
- Demonstrate date formats
- Demonstrate time formats
- Demonstrate SimpleDateFormat
- Simple Pattern Matching Demo
- String-Tokenizer
- BitSet
- Date method
- Calendar
- Gregorian-Calendar
- Random class-Guassian value
- Format
- Locale
- %g formatter
- Date-Format
- conversion-type-character argument
- Field width
- Table with Formatter
- Precision
- Justify
- Space Format
- Custom Date Format
- Resource-Management
- Average with Scanner
- FindInline
- String-Tokenizer
- ArrayList
- Arraylist to array
- Linkedlist
- hashset
- tree-creation
- array-deque
- iterator
- array-list
- mail-LinkedList
- hash-map
- Tree-map
- Custom-comparator
- comparator-by accountname
- collection-algorithm
- Arrays-class Operation
- Generic-collections
- Vector class-array
- Stack-class
- Hash-table
- HashTable-iterator
- Property-List
- Default-Properties List
- PropertiesList-Database
- ArrayList
- Double demo
- isInfinite() and isNaN()
- Sum of numbers
- Convert an integer into binary, hexadecimal and octal
- Demonstrate several Is... methods
- Demonstrate totalMemory(), freeMemory() and gc().
- Demonstrate exec()
- Wait until notepad is terminated
- ProcessBuilder demo
- Timing program execution
- Using arraycopy
- Show User Dir
- Demonstrate clone()
- Override the clone() method.
- Demonstrate Run-Time Type Information
- Demonstrate toDegrees() and toRadians()
- Double demo
- Construct One String from Another
- Construct String from Subset of Char Array
- Using Concatenation to Prevent Long Lines
- Override toString()
- getChars Demo
- equals() and equalsIgnoreCase
- equals() vs ==
- indexOf() and lastIndexOf()
- Substring replacement
- Using trim()
- toUpperCase() and toLowerCase()
- StringBuffer length vs. capacity
- charAt() and setCharAt()
- Demonstrate append()
- Using reverse() to reverse a StringBuffer
- Demonstrate delete() and deleteCharAt()
- replace()
- indexOf
- Construct One String from Another
- Generic class
- Non-Generic
- Generic with Two Parameters
- Generic class of Array
- Wildcard Demo
- Bounded Wildcard
- Generic Method
- Generic Constructor
- Generic Interface
- Raw-Type Generic
- Generic Class Inheritance
- Generic Inheritance with own Type Parameter
- Generic- Nongeneric Class Inheritance
- Instance of Operator
- Generic Method Override
- Bounded Type Parameter
- Generic Bridge Method
- Generic-array
- Generic class
- Simple Inheritance
- Private members in Inheritance
- Inheriting a class
- Extend box class to include color
- Assigning reference variable.
- super keyword
- Complete Implementation of BoxWeight
- Clone of object
- Use of Super()
- Order of calling of constructors
- Method Overriding
- Method Overriding: Super()
- Overloading in Inheritance
- Dynamic Method Dispatch
- Run Time Polymorphism
- Abstract
- Abstract Methods&Classes
- Final methods
- Final classes
- Simple Inheritance
- Method Overload
- Automatic Type Conversion
- Class Example
- Overloading Constructors
- Object Passing
- Object initializes another
- Call by Value
- Object Reference Passing
- Returning an Object
- Recursion
- Recursion Example
- Difference of Public and Private
- Defining an Integer Stack of a Class
- Variables, Methods and Blocks
- Static Demo
- Length of an Array
- Improved Stack class that uses the length array member.
- Inner Class
- Class Error with Variables Demo
- Defining Inner Class Within ForLoop
- String Demo
- String Methods
- String Array
- Passing Variable Number of Arguments
- Variable-Length Arguments
- Using varargs with standard arguments
- Varargs and Overloading
- Varargs, Overloading and Ambiguity
- Method Overload
- If-elseif
- Simple Switch
- Switch Example
- SwitchCase
- StringSwitch
- While Loop
- WhileLoop EmptyTarget
- DoWhileLoop
- Menu Selection using DoWhile
- ForLoop
- Find Primes
- ForLoop Example
- For Loop Initialization, Increment Decrement Using Comma
- Empty Parts of For Loop
- ForEach Style for Loop
- Using break with for-each
- The Use of ForEach
- Accessing 2D Array Using For-Each
- Using For-Each in Array Search
- Nested For Loop
- Exiting a Loop
- Break in While Loop
- Break with Nested Loops
- Using break as a civilized form of goto.
- Using break to exit from nested loops
- Error Scope in Break
- Continue Statement
- Continue with Label
- Return Statement
- If-elseif
-
TestProject90votes -
Declare Object77votes -
Final Modifier in java.30votes
-
-
Access Hidden Variable Example266votes -
Super Example251votes -
Method OverRiding Example65votes -
Pure Polymorphism Example35votes
-
-
Arithmetic exceptions235votes -
NumberFormatException215votes -
outOfBounds exception29votes
-
-
inheritance345votes -
Inheritance Example87votes -
Inheritance and Objects70votes -
InheritanceExample45votes -
Inheritance Example24votes
-
-
Visibility of methods327votes -
Multiple Constructors Example323votes -
Superclass241votes -
Comparing Two Objects ( Employee Example))219votes -
Class Field Example214votes -
visibility of variables190votes -
This Example184votes -
proper use of visibility in classes130votes -
Classes in arrays128votes -
Constructor with Parameters Example89votes -
Defining and Using Java Class73votes -
Calories Example70votes -
Constructor59votes -
Modify default constructor51votes -
Writing a Class with State and Behaviour48votes -
Nested classes40votes -
Winning Strategy for Roullete40votes -
Student class example38votes -
Inheritance - Extending a Class34votes -
Pizza28votes -
Class with Constructor Example14votes
-
-
Checking Equal Strings349votes -
Palindrome String289votes -
JavaStringVariables267votes -
Using equalsIgnoreCase()224votes -
Substituting a Character218votes -
join193votes -
Replacing substring with a String169votes -
The compare Method156votes -
Converting a Sequence of Characters151votes -
String Manipulation135votes -
Convert_String_To_Char_Array112votes -
Splitting a String81votes -
String to int and backwards79votes -
The substring Method77votes -
String Tokenizer77votes -
Declaring Strings Example75votes -
The index Of Method74votes -
String Tokenizer72votes -
The replace Method65votes -
Upper and Lower Case62votes -
Capital59votes -
Use of toString()59votes -
StringBuffer and related methods59votes -
Longest Word58votes -
StringReverse56votes -
Initial55votes -
String Equal Example54votes -
String comparison methods53votes -
Number of Vowels in a word.39votes -
valueOf37votes -
String34votes -
String Concatenation29votes -
String Concatenation27votes -
trim Method25votes
-
-
Accesing Arrays using For-Each Loop395votes -
Copying Array Example347votes -
Multi-Dimensional Array Initialization231votes -
Accessing MultiDimensional Arrays203votes -
Array Initialization and Sorting the array.203votes -
Triangle118votes -
Array Triangle Example99votes -
MatrixOperations68votes -
Arrays Example59votes -
Average of array elements59votes -
What is array?53votes -
Arrays and Strings51votes -
TwoD Array38votes -
Accessing One Dimensional Array36votes -
2D Arrays Initialization34votes -
Bubble Sort34votes -
Days in a Month- In an array31votes -
Array Declaration and Addition29votes -
Pascals Triangle26votes -
Array Copying25votes -
Accessing Arrays Example18votes -
Arrays and Loops18votes -
Array8votes
-
-
Static Methods376votes -
Object As parameter370votes -
Method Reference Example220votes -
area Method example77votes -
multitype arguments68votes -
Calculating Square and Cube49votes -
void Methods46votes -
Pair of Dice37votes -
Method Parameters33votes -
Defining Methods29votes -
Passing the Value27votes -
Method Overloading Example13votes
-
-
While loop381votes -
Reinforcement326votes -
Continue Statement315votes -
Alphabet Looping299votes -
While Loop Syntax212votes -
For Loop Example186votes -
MultiplicationTable182votes -
even_odd_program143votes -
For loop138votes -
For Loop Example 2132votes -
While Loop Example125votes -
First Five Natural Numbers113votes -
sum_of_odd_nums103votes -
Do While Loop Example103votes -
Fibonacci70votes -
Prime Number Test68votes -
pattern55votes -
The Numerical for Loop41votes -
break command39votes -
continue command36votes -
The while Loop29votes -
Do While Syntax28votes -
for-each Construct on Arrays24votes -
Reversing and Counting Number of digits in a number23votes -
Loops23votes -
break & continue22votes
-
-
Switch Statement383votes -
Another Switch Example305votes -
Else Statement178votes -
Multiple Else Statements89votes -
Testing out all cases74votes -
Celsius and Fahrenheit conversion70votes -
If Statement65votes -
Day of the Week56votes -
Month from Number Using SwitchCase55votes -
LetterGrade53votes -
Bytes into a representation with metric units45votes -
Control in a loop39votes -
DIfferent Basic Kinds Of Loop38votes -
IF Statement In Java.26votes -
CheckYourGrades26votes -
IF Conditional Statement In Java24votes -
Making Decisions6votes
-
-
PrePost Increment275votes -
Arithmetic operators154votes -
Overflow demonstration40votes -
The arithmetic sequence program38votes -
Complex Arithmetic36votes -
Complex Arithmetic34votes -
Trig functions in Java28votes -
Reinforcement27votes -
Arithmethic ASCII Table27votes
-
-
Class Member Access (Dot) Operator314votes -
Binary Operator188votes -
AdditionOfTwoNumbers145votes -
Relational Operator145votes -
More Operators142votes -
Boolean Operators139votes -
EasterAlgorithm116votes -
IncrementDecrementOperator99votes -
The equals Method89votes -
Comparison of integer values60votes -
Logical operators59votes -
Unary Operator57votes -
Ternary Operator56votes -
ArithmeticOperators on integer56votes -
Logical Operators on Boolean values56votes -
Shorthand Operators49votes -
Arithmetic operators41votes -
Logical Operators38votes -
Assignment operators36votes -
Relational operators36votes -
Operator Precedence35votes -
instanceOf Operator35votes -
Comparing the three values with ternary operator30votes -
Expression Evauation26votes -
Conditional Operator24votes -
Bitwise Operators22votes -
Addition without using any arithmetic operator21votes
-
-
Static and Final variable287votes -
Usage of final variable.239votes -
Instance variable206votes -
Addition Of Two Variables192votes -
Short Variable.190votes -
Different data types179votes -
Explicit Conversion150votes -
Local Variable126votes -
Two Variables87votes -
Short and Float Varible82votes -
Short79votes -
Character Datatypes72votes -
Integer66votes -
Single Variable60votes -
Printing different values60votes -
Compute distance light travels in given days using Integer Variables.57votes -
Working with References55votes -
Decimal Dropping55votes -
Variables55votes -
Lifetime51votes -
Different way to print variables48votes -
Compute Area of Circle46votes -
Using int36votes -
Class level and Function Level Variable34votes -
Scopes in Java33votes -
Scope29votes -
Creating variables in Java27votes -
Input to different type variable27votes -
Dynamic initialization in Java24votes
-