I wanted to create a Calc class so that I could use simple static methods like Calc.sum( an array with numbers inside) to,well,carry out simple calculations. Simple enough until i got to the the division method.
for the sum method i wrote this:
Sure enough this method doesn't work with division. Can you please give me hints on how to solve this? I kind of want to solve this by myself and I am not asking for code or anything since i mainly want to do this for the sake of learning. I tried using nested for loops, but i just got confused and made whatever i already had more complex.
Thanks for that insightful reply Henry I have just began reading Inheritance and Polymorphism in Head First. Method overloading sounds a bit to complicated for now :P
I created a Print Class so i wouldn't have to type out System.out.print each time. I used Object for that, so the user can input String, double, int, etc.... But I am not sure how flexible and secure that is...Although i did convert the Object to String in my method, not sure if that would help with anything though.
Thanks for the great info.