An ideal artificial intelligence-based autonomous system, interacting with a dynamic environment, is required to learn continuously as human do. Human beings retain the learned knowledge, accumulate, and utilize it to solve related problems. Currently, most artificial intelligence-based systems lack this capability and work in an isolated learning paradigm. In this paper, we present a novel continual learning model to solve the challenging problem of real-world images classification. The proposed model is capable of learning continuously by utilizing the previously learned knowledge. It can handle both multi-task and single incremental task scenarios as opposed to various existing models that cover only the multi-task scenarios. In the proposed model, a deep convolutional autoencoder is presented to extract features from images. In addition, a learning classifier system with an effective knowledge encoding scheme is proposed for mapping real-world images to code fragment-based compact knowledge representation. Experiments are conducted on three benchmark image datasets to validate the model: (i) CORe50, (ii) iCubWorld28, and (iii) STL-10. Experiments results demonstrate that the proposed model outperforms the baseline method as well as various state-of-the-art methods for both continual learning scenarios.