Question: a. Create a Class called River. Declare two private variables in it: One a string called nameofRiver and the other integer lengthofRiver b. Create the

a. Create a Class called "River. Declare two private variables in it: One a string called "nameofRiver and the other integer lengthofRiver b. Create the getter and setter methods from them: getNameofRiver, setameofRiver, getLengthofRiver, setLengthofRiver. Setters expect one parameter and getters return one a. From your "main method, declare an object called firstRiver of the Class River, and instantiate it, with ne. b. From your main' method, declare another object called "secondRiver of the Class River, and instantiate it, with "new" c. Initialize the nameofRiver and lengthofRiver variables of the instantiated object firstRiver with "Amazon" and 6489, by calling the setNameofRiver and setLengthofRiver methods. d. Initialize the namofRiver and lengthofRiver variables of the instantiated object 'secondRiver withJames" and 348, by calling the setNameofRiver and setLengthofRiver methods. e. Print four words "Amazon length is 6488" (the first and the last from calling the getNameofRiver and getLengthofRiver methods) f. Print four words "James length is 348 (the first and the last from calling the getNameofRiver and getLengthofRiver methods)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
