Skip to content

DahlitzFlorian/java-snippets

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Java Snipptes

Description

Including smaller Java snipptes this repository was created to learn the Java programming language and to save useful code snippets. It's used for educational purposes only. No versioning needed. A list of available snippets is provided beneath.

Available Snippets

Class/Folder Name Description
ArrayVSArrayList Compares the usage of standard arrays and ArrayList
CEExample Provides an example of a checked exception
CompoundAssignmentOperators Provides several examples of compound assignment operators
exceptions Includes a custom exception class and a tester class
IncrementDecrementOperators Illustrates the different behaviour of prefix- and postfix-incrementation/decrementation
interfaces Demonstrates the usage of multiple interfaces
LabeledStatements Introduces the usage of labeled statements
lambda Reveals the usage of lambda expressions in connection with the Stream API
LegalFishSizes Example of how to use the enhanced for-loop (with conditions)
ListFiles Walks through a given directory and logs all available text-files
LogicalOperatorsOutput Shows the evaluation steps of the different logical operators
MultiCatchClause Shows the proper usage of multi-catch-clauses
packaging Includes classes to learn packaging and a description on how to compile and run them
polymorphism Demonstrates the concept of polymorphism using interfaces
PropertiesManager Lists all system properties - created to test java interpreter switches
Ships Provides a set of classes and interfaces to give an understanding of class structuring
StringSwitch Illustrates the usage of Strings in switch-statements (>= Java SE 7)
TryFinally Demonstrates the behaviour of the try-finally-statement
TryWithResources Illustrates the usage of a try-with-resources-statement