Give Java solution to Bounded buffer problem. import java.io.*; class Buffer { private final int MaxBuffSize; private char[] store; private int BufferStart, BufferEnd, BufferSize; public Buffer(int size) { MaxBuffSize = size; BufferEnd = -1; BufferStart = 0; BufferSize = 0; store = new char[MaxBuffSize]; } public synchronized void insert(char ch) { try { while (BufferSize == MaxBuffSize) { wait(); } BufferEnd = (BufferEnd + 1) % MaxBuffSize; store[BufferEnd] = ch; BufferSize++; notifyAll(); } catch (InterruptedException e) { Thread.currentThread().interrupt(); } } public synchronized char delete() { try { while (BufferSize == 0) { wait(); } char ch = store[BufferStart]; BufferStart = (BufferStart + 1) % MaxBuffSize; BufferSize--; notifyAll(); return ch; } catch (InterruptedException e) { Thread.currentThread().interrupt(); return 'i'; } } } class Consumer extends Thread { private final Buffer buffer; public Consumer(Buff...
//Constructor class TestConstructor { int a,b; TestConstructor() { System.out.println("Default Constructor!!"); a=10; b=20; System.out.println("value of a="+a); System.out.println("value of b="+b); } } class MainConstructor { public static void main(String args[]) { TestConstructor obj=new TestConstructor(); } } ...