Literals(often referred to as constants) are data items that are fixed data values. Java allows several kinds of literal: integer-literalfloating-literalboolean-literalcharacter-literalstring-literalnull-literal…