how could i make a class should be immuable

Posted on 2012-09-12
Last Modified: 2012-09-12
how could i make a class should be immuable
Question by:stmani2005
    LVL 19

    Accepted Solution

    LVL 8

    Author Comment

    please give me the exac pseudo code for make the class should be immutable
    LVL 16

    Expert Comment

    public final class FinalClass {}
    LVL 16

    Expert Comment

    import java.lang.reflect.Modifier;
    public final class FinalClass{
    public static void main(String[] args){
    System.out.println("This class is "+Modifier.isFinal(Class.forName("FinalClass").getModifiers())+"ly final.");
    }catch(ClassNotFoundException cnge){}

    Open in new window


    Featured Post

    Threat Intelligence Starter Resources

    Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

    Join & Write a Comment

    Suggested Solutions

    INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
    Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
    Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
    This video teaches viewers about errors in exception handling.

    729 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    24 Experts available now in Live!

    Get 1:1 Help Now