MCPcopy Create free account
hub / github.com/PrajaktaSathe/Java / delete

Method delete

Programs/NoDupArray.java:51–64  ·  view source on GitHub ↗
(long value)

Source from the content-addressed store, hash-verified

49
50
51 public boolean delete(long value) {//delete the element if it found
52 for(int i=0;i<this.nElements;i++){
53 if(this.a[i]==value){
54 for(int j=i; j<this.nElements-1;i++){
55 this.a[j]=this.a[j+1];
56 }
57 this.nElements--;
58 System.out.println("Value Deleted");
59 return true;
60 }
61
62 }
63 return false;//value is not found for deletion
64 }
65
66
67 public void display() {//display array contents

Callers 1

mainMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected