Search:

Type: Posts; User: xways

Search: Search took 0.09 seconds.

  1. Replies
    10
    Views
    2,433

    Re: Printing the method return from another class

    ye i forgot to put on // on that line Calculator.sum(num1, num2);, so the compiler ignores my statement and use yours. but oh my god.. changing static int print() { to static void print() { did it,...
  2. Replies
    10
    Views
    2,433

    Re: Printing the method return from another class

    the error is right after the System.out.println("Sum of the numbers: " + theSum); which is line24, and pointing to the next "}" bracket.(line25)


    import java.util.Scanner;

    public class...
  3. Replies
    10
    Views
    2,433

    Re: Printing the method return from another class

    thanks again for the quick reply, yes i tried that already too but now i just copied yours in case my brain melted already these days im trying to figure that out and well it still doesnt work... :/...
  4. Replies
    10
    Views
    2,433

    Re: Printing the method return from another class

    yes i understood, it basically cannot find sum in the Printer class. So thats the question im asking for, how to get that sum value from the Calculator class into the Printer class to print its value...
  5. Replies
    10
    Views
    2,433

    Re: Printing the method return from another class

    Hey thanks for reply.
    Just to let u know, i tried alot of diffrent things in this line of code too, but this is the last i left in this line, anyway the error msg is:
    ObjectFunctionality.java:24:...
  6. Replies
    10
    Views
    2,433

    Printing the method return from another class

    Hello, i cant get the return value to my Printer class from the Calculator class method. i have just started to learn about objects/constructors and in some way i cant understand it, even though i...
Results 1 to 6 of 7