Re: cannot find symbol Error
So I recompiled the program again and now Im getting these errors:
cannot find symbol
symbol : class Buffer
location: class SharedBufferTest
Buffer sharedLocation = new UnsynchronizedBuffer();
^
./UnsynchronizedBuffer.java:9: cannot find symbol
symbol: class Buffer
public class UnsynchronizedBuffer implements Buffer {
^
./Producer.java:10: cannot find symbol
symbol : class Buffer
location: class Producer
private Buffer sharedLocation;
^
./Producer.java:14: cannot find symbol
symbol : class Buffer
location: class Producer
public Producer (Buffer shared, Semaphore valueP, Semaphore valueC) {
^
SharedBufferTest.java:16: internal error; cannot instantiate Producer.<init> at Producer to ()
Producer producer = new Producer( sharedLocation );
^
./Consumer.java:10: cannot find symbol
symbol : class Buffer
location: class Consumer
private Buffer sharedLocation;
^
./Consumer.java:14: cannot find symbol
symbol : class Buffer
location: class Consumer
public Consumer (Buffer shared, Semaphore valueP, Semaphore valueC) {
^
SharedBufferTest.java:17: internal error; cannot instantiate Consumer.<init> at Consumer to ()
Consumer consumer = new Consumer( sharedLocation );
^
./Consumer.java:30: inconvertible types
found : <nulltype>
required: int
sum += sharedLocation.get();
Re: cannot find symbol Error
Double posted and answered on the Oracle forums.
New To Java - cannot find symbol
db