-3

I'm not a good with java and trying to get implementation from it. I'm running this code, but I got a lot of errors. Main error in

StdOut cannot be resolved

Abdul Fatir
  • 6,159
  • 5
  • 31
  • 58

4 Answers4

0

Replace StdOut with System.out, or add this in the class:

OutputStream StdOut = System.out;
Anubian Noob
  • 13,426
  • 6
  • 53
  • 75
  • Thanks, This helps me. I got one more error in: for (int j = 0; j < N; j++) c[j] = StdRandom.uniform(1000); for (int i = 0; i < M; i++) b[i] = StdRandom.uniform(1000); for (int i = 0; i < M; i++) for (int j = 0; j < N; j++) A[i][j] = StdRandom.uniform(100); Simplex lp = new Simplex(A, b, c); System.out.println(lp.value()); } Error in StdRandom – user3688368 May 29 '14 at 18:57
  • 1
    @user3688368 That's a new question, ask it seperately. – Anubian Noob May 29 '14 at 19:06
  • same thing you as this example. you need to import your random class – Frank Visaggio May 29 '14 at 19:41
0

Like Anubian said, use System.out

Or simply compile this, and place it with your Simplex.java Class file

Got this from the Princeton repository.

Benjamin Trent
  • 7,378
  • 3
  • 31
  • 41
Nithin
  • 11
  • 2
0

StdOut is not declared in the scope. You may be missing an include. The best fix if you are using the Java API is to replace "StdOut" with "System.out". Also be sure to include java.lang.System.

Kylelem62
  • 569
  • 4
  • 17
0

This class is in stdlib.jar . you need to include that jar in your class path to remove these errors. Unfortunatly thic class StdOut does not have package declaration So you can not import it.

You have to create you class in default package to use this class.

I will suggest to use some other output stream.

Sumit Tyagi
  • 431
  • 2
  • 14