having problems with these errors any help Fljava work cosc 3 File Edit Iools Pr
ID: 3907537 • Letter: H
Question
having problems with these errors any help
Fljava work cosc 3 File Edit Iools Project Language Level Help New Open?Save [.. Close %Cut?Copy Paste ?Undo eRedo Find Compile Reset Run Test Javadoc Code Coverage Unticled inport edu.princeton.es.algs4.Veightlui ckUnionUF: /use eclipse conpiler 4.5 WeightedauickUnionUF.jvapublic class percolation private int n; private int upgrid: private int dongrid; private FeightQuickUnionUF ickunion: private VeightuicknionuF uickunionPer: private boolean open: public percolation(int n) if(n(#0) throw nev 111egalArgumentException ("n(#0" ); quicknion-new WeightQuickUnionUF (nod) quickunionPe?nev VeightJuickUnionUF (nod); // int nod-(n+2)2: open-nev boolean[nod]; this.n-n; upgrid-D://establish top grid close it Interactions Console Compiler Output 13 errors found: File: F:java work cosc 33041percolation.java [line: 1] Error: The 1mport edu.princeton.cs.algg4.Weightqu1ckunionUF cannot be resolved File: F:1java work cosc 3304percolation.java [line: 8 Error: WeightQuickUnionUF cannot be resolved to a type File: E:java work cosc 3304percolation.java ine: 9] Error: WeightguickUnionUF cannot be resolved to a type File: F:ava work cosc 3304 percolation.ava [iine: 30] Brror: Syntax error, insert "" to complete Block File: F:java work cosc 33041percolation.java [line: 52] Error: WeightquickUnionUF cannot be resoived to a type Pile: F:java work cosc 3304 percolation.java [line: 53] Compiler Eclipse Compiler 4.5 #4:) all 7:58 AM 6/22/2018Explanation / Answer
As per code, It means WeightQuickUnionUF class is being referred from package edu.princeton.cs.algs4.WeightQuickUnionUF class.
But as i can see, the class WeightQuickUnionUF is currently present in your current package. So you don't need to refer to edu.princeton.cs.algs4.WeightQuickUnionUF package. You can remove this import and the code should work properly, because class is in the same package.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.