Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Hi I have a worksheet question I do not understand

 
Mark Cuff
Greenhorn
Posts: 2
Java Ubuntu Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Write a line of code to call the method SixTimes() with the object myObject and output the results.
Thanks
 
Kemal Sokolovic
Bartender
Posts: 825
5
Java Python Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Mark and welcome to the Ranch!

Please UseAMeaningfulSubjectLine for the topics you create and ShowSomeEffort when facing a problem.

The issue you are having is pretty simple, and requires some basic knowledge of Java programming.
Suppose you have the following class:

Now if you want to invoke a foo() method on an object of Foo class from, say, main method, you would write:

You can use the code above as a guideline for your question.
 
Mark Cuff
Greenhorn
Posts: 2
Java Ubuntu Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi thanks for your response my problem is I have the java main and the driver and i am not really understanding to make one read from the other.
 
Dev Looper
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Mark,

As Kemal mentioned, state your problem clearly so that you could be helped..

1. what is 'the worksheet' question?..from the heading, it looks like you are reading an excel spreadsheet into a Java obj.
2. you just need to loop it through the worksheet rows, check if they are not nil, and then read the values...you might want to take a look at jxl.jar library.
3. what form of output are you expecting?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic