Logo 
Search:

Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds

Create a constructor class Sum

  Asked By: Celucolo    Date: Feb 17    Category: Java    Views: 5002
  

Create a constructor class Sum that has public integer variables num1 and num2. Include a default constructor and a method Add that accepts the two integer parameters, calculates and outputs the sum. In your main class Calculate include a main method that prompts the user to enter 2 integer values and create a reference called total for the constructor Sum. Output the values entered by the user and the sum of the values in the command line window.
class StudentData

Share: 

 

No Answers Found. Be the First, To Post Answer.

 
Didn't find what you were looking for? Find more on Create a constructor class Sum Or get search suggestion and latest updates.




Tagged: