A negative selection algorithm generates detectors to realize abnormality detection by simulating the maturation process of T cells in human immunity. Holes are areas of feature space that cannot be covered by the detector set and are the major factor in the degradation of algorithm performance. Conventional methods alleviate the hole problem by minimizing the coverage area of the holes. In this study, we approach the issue from a different angle. Holes are prone to form in the boundary area between the self and nonself regions, and when the self and the nonself cross or overlap, the hole problem becomes more serious. The k-nearest neighbors (k-NN) algorithm is more suitable than other methods for pending instance sets where the class domain crosses or overlaps more. Therefore, we propose a hybrid real-valued negative selection algorithm with variable-sized detectors (V-Detector) and the k-NN algorithm, abbreviated as V-Detector-kNN. The V-Detector-kNN hybrid algorithm first uses the V-Detector algorithm to classify, and then, for the problem that the nonself instances in the holes are misclassified as selfs, k-NN is introduced to classify those misclassified instances to improve the detection rate. Theoretical analysis proves that the V-Detector-kNN algorithm that we proposed has a higher detection rate than the V-Detector algorithm in most cases. Comparative experiments with 5 different algorithms on 9 UCI datasets show that our proposed algorithm ranks first in detection rate.