Search:

Type: Posts; User: Norm

Search: Search took 0.23 seconds.

  1. Replies
    10
    Views
    2,450

    Re: Printing the method return from another class

    Our posts crossed. Check my last post
  2. Replies
    10
    Views
    2,450

    Re: Printing the method return from another class

    class Printer {
    static int Print() {

    Scanner reader = new Scanner(System.in);

    System.out.println("Type in the first integer: ");
    int num1 = reader.nextInt();
    System.out.println("Type...
  3. Replies
    10
    Views
    2,450

    Re: Printing the method return from another class

    The sum method returns the sum of the two int values passed to it.
    The calling code needs to save the value returned by the sum method in a variable so that it can work with it locally:

    int...
  4. Replies
    10
    Views
    2,450

    Re: Printing the method return from another class

    [QUOTE]ObjectFunctionality.java:24: error: cannot find symbol[/QUOTE
    The compiler can not find a declaration for the variable: sum that is in scope (declared within the same {}s) on line 24.
    Where...
  5. Replies
    10
    Views
    2,450

    Re: Printing the method return from another class

    Please explain. What happens? If there are error messages, copy the full text and paste it here.
Results 1 to 5 of 5