Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 422
  • Last Modified:

how could i make a class should be immuable

how could i make a class should be immuable
0
Manikandan Thiagarajan
Asked:
Manikandan Thiagarajan
  • 2
1 Solution
 
Daniel Van Der WerkenIndependent ConsultantCommented:
0
 
Manikandan ThiagarajanSenior consultantAuthor Commented:
please give me the exac pseudo code for make the class should be immutable
0
 
krakatoaCommented:
public final class FinalClass {}
0
 
krakatoaCommented:
import java.lang.reflect.Modifier;

public final class FinalClass{


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

}

Open in new window

0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now