Question: JAVA PROGRAMING. Due date: Today, at the end of the lab period In this exercise we will implement the NaturalNumber class that represent the positive
Due date: Today, at the end of the lab period In this exercise we will implement the NaturalNumber class that represent the positive integers ie integer >-0) The class has only one attibute int value. A. Implement the constructor that does not take any parameter and initialize value to its B. Implement a constructor with a parameter. The method throws an exception C. Implement getter. Implement also setter that throws an exception ErrModifException if the D. Implement the methods: void add (NaturalNumber x) that increment the value of the default value O ErrConstrException if the parameter is
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
