Java Cheat Sheets

featured image

In this article we will study the Java Cheat_Sheets that will help to review, recollect and memorize the syntaxes of Java, key aspects of Java like formatted output, collections, regular expressions, etc..

To study the cheat sheets of java go through the syntax’s given below:

    1. Writing packages:

    1. What are different types of Java Extension Packages:


      • Java Packages are given below:


        1. java.applet : Applets (Consists of Java program’s that runs inside a webpage)


        1. java.awt : It supports graphics and graphical user interfaces


        1. java.beans : Support for JavaBeans components i.e. classes with properties and event listeners.


        1. : Supports Input and Output


        1. java.lang : It provides Language support.


        1. : Networking


        1. java.rmi : Allows Remote method Invocations


        1. java.sql : Provides database support


        1. java.text : Supports internationalized formatting of text and numbers


        1. java.util : Provides Utilities which includes data structures, concurrency,etc..



    1. Writting comments in java


      • // is used for writing Single Line Comment.


      • /* is used for multiple line comment */


    1. Data types in Java


      • int -> consists of integer set of values.


      • double -> consists of floating – point numbers


      • boolean -> Boolean values like && || ! true false


      • char – > It is character set of values


      • String -> It has sequence of characters like “AB” “Hello” “2.5”


    1. Comparison operators in Java



    1. Creating new object instance

    1. Printing a String to standard output

    1. Creating a new object using generic types (array list that holds strings)

    1. Sample code structure in Java

    1. Input and Output functioning in java



    1. Incremental / Decremental Operators


      • ++X = PreIncrement Operator


      • X++ = PostIncrement Operator


      • –X = PreDecrement Operator


      • X– = PostDecrement Operator


    1. Escapes Sequences in java


      • \n = is used for new line


      • \t = is used for horizontal tab


      • \r = It is for carriage return


      • \\ = It is backslash


    1. If Else syntax in java

    1. Implementing Switch Case in java

    1. Loops in java


      • For Loop

      • While Loop

      • Do While Loop


    1. Writing class in java

    1. Exception handling in java

    1. Arrays in Java


      • Declaring and allocating an array in one

      • Declaring and allocating in two


    1. File IO in Java


      • Read in a Text File

      • Write to Text File

Thus, these are the basic Java Cheat_Sheets which will help and guide you as a quick references of Java syntax’s. It will be effective in many different ways if you master it right. If you are given any Java assignment and if you are not familiar with the Java syntax’s it will prove very beneficial and a quick guide for beginners.


Please enter your comment!
Please enter your name here