Last week, we had the author of TDD for a Shopping Website LiveProject. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See for the agenda and registration link
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

creating methods

 
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello all, I am trying to create methods that perform certain computations. Some of the methods have already been written for a previous assignment. However, I am to insert 2 of these methods into a class; and be able to invoke these methods from other classes I write. SO I have to edit the return type of each method; and edit the method to accomadate the class it will be in. When I write new classes, does my class file that contains these methods need to be placed in the same directory(folder) as the new class for which I am writting. I assume so. But for some odd reason I am getting an error while trying to invoke one of these methods in another class file. THis is what I have so far. Maybe someone could shed some light on what I am doing wrong. I would like to test each method in myUtils file class to make sure it returns what it is suppose to. SO I am creating little programs on the side to test it. Anyways, here is what I got.
This is my test class.

Furthermore, this is my class containing the methods I wish to invoke.
 
author
Posts: 23919
142
jQuery Eclipse IDE Firefox Browser VI Editor C++ Chrome Java Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It would help if you mention what the is exception that you are encountering.

However, at a quick glance, you are trying to call an isInteger() method of the String class -- which is not possible.

Henry
 
Mike Smith
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
OOps, thanks for noticing. I will try to debug the problem. My question I guess wasn't clear. Thats okay, i'll keep you posted. thanks again.
 
My honeysuckle is blooming this year! Now to fertilize this tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic