Java constant

March 29, 2022 · Team EasyExamNotes · 1 min read (est.) · 0 comments

Share on WhatsApp

PROGRAM:

To show constant.

/**
             * @Prof. Jayesh
             * Here age is constant, which have fix value 28.
             */

public class ConstantClass {
            public static void main(String args[]){
                        int age = 28;
                        System.out.println(“age= “+Age);
            }
}

OUTPUT:
age= 28


Discussion

Ask a question, share your thoughts or report an error.

Sign in to participate in the discussion.

Join the discussion