CloneNotSupportedException in Java with Examples Last Updated : 24 Sep, 2021 Comments Improve Suggest changes 2 Likes Like Report CloneNotSupportedException is thrown to show that the clone method in class Object has been called to clone an object, but that the object's class does not implement the Cloneable interface. Hierarchy: Those applications which override the clone method can also throw this type of exception to indicate that an object couldn't or shouldn't be cloned. Syntax: public class CloneNotSupportedException extends Exception Example of CloneNotSupportedException : Java // Java program to demonstrate CloneNotSupportedException class TeamPlayer { private String name; public TeamPlayer(String name) { super(); this.name = name; } @Override public String toString() { return "TeamPlayer[Name= " + name + "]"; } @Override protected Object clone() throws CloneNotSupportedException { return super.clone(); } } public class CloneNotSupportedExceptionDemo { public static void main(String[] args) { // creating instance of class TeamPlayer TeamPlayer t1 = new TeamPlayer("Piyush"); System.out.println(t1); // using try catch block try { // CloneNotSupportedException will be thrown // because TeamPlayer class not implemented // Cloneable interface. TeamPlayer t2 = (TeamPlayer)t1.clone(); System.out.println(t2); } catch (CloneNotSupportedException a) { a.printStackTrace(); } } } Output : Create Quiz Comment P piyushkr2022 Follow 2 Improve P piyushkr2022 Follow 2 Improve Article Tags : Java Java-Exceptions Explore Java BasicsIntroduction to Java3 min readJava Programming Basics9 min readJava Methods6 min readAccess Modifiers in Java4 min readArrays in Java7 min readJava Strings7 min readRegular Expressions in Java3 min readOOP & InterfacesClasses and Objects in Java5 min readAccess Modifiers in Java4 min readJava Constructors4 min readJava OOP(Object Oriented Programming) Concepts10 min readJava Packages2 min readJava Interface7 min readCollectionsCollections in Java12 min readCollections Class in Java13 min readCollection Interface in Java4 min readIterator in Java4 min readJava Comparator Interface5 min readException HandlingJava Exception Handling6 min readJava Try Catch Block4 min readJava final, finally and finalize4 min readChained Exceptions in Java3 min readNull Pointer Exception in Java5 min readException Handling with Method Overriding in Java4 min readJava AdvancedJava Multithreading Tutorial3 min readSynchronization in Java7 min readFile Handling in Java4 min readJava Method References9 min readJava 8 Stream Tutorial7 min readJava Networking6 min readJDBC Tutorial5 min readJava Memory Management3 min readGarbage Collection in Java6 min readMemory Leaks in Java3 min readPractice JavaJava Interview Questions and Answers15+ min readJava Programs - Java Programming Examples7 min readJava Exercises - Basic to Advanced Java Practice Programs with Solutions5 min readJava Quiz1 min readJava Project Ideas For Beginners and Advanced15+ min read Like