Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 662031
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T23:20:00+00:00 2026-05-13T23:20:00+00:00

Here is the code: class Time { public static void printTime (int hour, int

  • 0

Here is the code:

class Time {
public static void printTime (int hour, int minute) {
System.out.print (hour) ;
System.out.print (":") ;
System.out.print (minute) ; 
} 

public static void main (String[] args) {
hour = 11 ; 
minute = 30 ;
printTime () ; 

}
}

Here is what terminal says when I try to compile it:

david-allenders-macbook-pro:~ davidallender$ Javac Time.java
Time.java:9: cannot find symbol
symbol  : variable hour
location: class Time
hour = 11 ; 
^
Time.java:10: cannot find symbol
symbol  : variable minute
location: class Time
minute = 30 ;
^
Time.java:11: printTime(int,int) in Time cannot be applied to ()
printTime () ; 
^
3 errors
david-allenders-macbook-pro:~ davidallender$ 

I’m in the process of learning so I don’t really know what’s going on. Right now I’m in the section in the book about parameters in/on/within/above/preposition (I’m not sure what the right preposition is) methods.

  • What does a parameter do?
  • Why is it useful?
  • What did I do wrong in the above code?
  • What did the error message mean?
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T23:20:00+00:00Added an answer on May 13, 2026 at 11:20 pm

    Parameters give a method information it needs to do its job. For example, a function to find the square root of a number would have that number as a parameter.

    You need to pass arguments to give the parameters values. So instead of trying to set minute and hour in the main method, you need to call

    printTime(11, 30);
    

    As a sort of meta-comment, this is the kind of thing you tend to learn pretty early – and while sites like this can help you with specific questions, you’d be better off reading a good entry level book about Java. If you’re already reading a book but it didn’t describe parameters clearly, you might want to think about getting another book 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here's the code: class qual { public static int fibonacci(int n) { if (n
here is the code (java): class prime { public static boolean prime (int a,
Here's the code: package testpack; import java.io.*; public class InputStreamReadDemo { private void readByte()
Here is my code: class Soldier { public: Soldier(const string &name, const Gun &gun);
here's the code: class Acount { int sum ; String owner ; //these seem
In the following code: public class A { public A():this(null){} public A(string b){/*code here*/}
Please refer to the Java code below: class Base{ Base(){ System.out.println(Base Constructor); method(); }
here is working java code class Cup { public String sayColor() { return i
I have the code : public void AlarmStart() { Calendar cal = Calendar.getInstance(); cal.add(Calendar.MINUTE,
Given the following Java code: public class Test { static private class MyThread extends

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.