Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 4 of 4

Thread: Well i got some kind of problem here?

  1. #1
    Junior Member
    Join Date
    Apr 2014
    Posts
    22
    My Mood
    Lonely
    Thanks
    1
    Thanked 1 Time in 1 Post

    Question Well i got some kind of problem here?

    So i was practesing with Scanner and delay...
    This happened and i dont know whats wrong?
    It has something to do with delay but i cant figure it out?
    import java.util.Scanner;
     
    public class ReactionGame {
     
    	public static void main(String[] args) {
    		Scanner NewScanner = new Scanner(System.in);
    		System.out.println("Type K and press enter when STOP appears");
    		Delay(1000);
                    System.out.println("STOP");
    		String s = NewScanner.nextLine();
    		System.out.println("You can do better!");
    	}
    }

    I dont know why the "Delay(1000)" doesnt work?!?!?

    heres the error response.

    Exception in thread "main" java.lang.Error: Unresolved compilation problem:
    The method Delay(int) is undefined for the type ReactionGame

    at ReactionGame.main(ReactionGame.java:8)

    Hope someone can figure this "Easy" Thing out!

    Have fun coding!

    Greetings,
    Niels


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,042
    Thanks
    63
    Thanked 2,708 Times in 2,658 Posts

    Default Re: Well i got some kind of problem here?

    The method Delay(int) is undefined for the type ReactionGame
    The compiler can not find a definition for the method Delay().
    Where is that method defined?
    If you don't understand my answer, don't ignore it, ask a question.

  3. #3
    Junior Member
    Join Date
    Apr 2014
    Posts
    22
    My Mood
    Lonely
    Thanks
    1
    Thanked 1 Time in 1 Post

    Default Re: Well i got some kind of problem here?

    Quote Originally Posted by Norm View Post
    The compiler can not find a definition for the method Delay().
    Where is that method defined?
    Ehh I honestly dont know how to get a method... i just make alot of simple games... If you could explain me how I use a "Method" because I dont know.

    EDIT: I got the Delay(int) from the internet thinking it would work. I could use a tutorial if you want to give me that,
    Last edited by Niels van Ee; April 9th, 2014 at 12:47 PM.

  4. #4
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,042
    Thanks
    63
    Thanked 2,708 Times in 2,658 Posts

    Default Re: Well i got some kind of problem here?

    Take a look at the tutorial:
    Defining Methods (The Java™ Tutorials > Learning the Java Language > Classes and Objects)
    Passing Information to a Method or a Constructor (The Java™ Tutorials > Learning the Java Language > Classes and Objects)

    Basically methods need to be defined before they can be called.
    If you don't understand my answer, don't ignore it, ask a question.

  5. The Following User Says Thank You to Norm For This Useful Post:

    Niels van Ee (April 9th, 2014)

Similar Threads

  1. There is some kind of Exception - Do not know the problem
    By Nexcit in forum What's Wrong With My Code?
    Replies: 4
    Last Post: March 23rd, 2014, 05:07 AM
  2. What kind of job's position is this?
    By solvable in forum What's Wrong With My Code?
    Replies: 5
    Last Post: January 10th, 2014, 02:02 PM
  3. someone please be kind enough demonstrate a code like this......
    By willc86 in forum What's Wrong With My Code?
    Replies: 3
    Last Post: January 23rd, 2013, 06:32 AM
  4. [SOLVED] What kind of object instantiation is this?
    By Lord Voldemort in forum Object Oriented Programming
    Replies: 3
    Last Post: July 7th, 2011, 07:00 AM
  5. Which collection is best to do mathematical operation on it?
    By Sterzerkmode in forum Java Theory & Questions
    Replies: 1
    Last Post: May 7th, 2009, 04:48 AM

Tags for this Thread