Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

creating methods

 
Mike Smith
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
  • 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.
 
Henry Wong
author
Marshal
Pie
Posts: 21403
84
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • 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
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic