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 5 of 5

Thread: creating a controller to allow instances to be created from keyboard

  1. #1
    Junior Member
    Join Date
    Oct 2009
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Exclamation creating a controller to allow instances to be created from keyboard

    Hi,

    I was wanting some help creating a controller for 2 classes which I have already created, Academic and Employee. I have not created a controller before and so I am a little unsure as to where to begin with this. I have had a look online at some tutorials but all seems a little more complex than what I feel my sepcification requires.

    This is my first Java assignment, for the higher marks we have not been given much detail, but simply asked to create a controller which allows instances of Employee and Academic to be created from the keyboard.

    Could someone please help me with this. It would be greatly appreciated.

    Many thanks


  2. #2
    Super Moderator Json's Avatar
    Join Date
    Jul 2009
    Location
    Warrington, United Kingdom
    Posts
    1,274
    My Mood
    Happy
    Thanks
    70
    Thanked 156 Times in 152 Posts

    Default Re: creating a controller to allow instances to be created from keyboard

    I'm not really sure I know what that actually means to be honest, is the controller just a new class which creates Employees and Academics?

    // Json

  3. #3
    Junior Member
    Join Date
    Oct 2009
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: creating a controller to allow instances to be created from keyboard

    yes, by allowing keyboard input...

  4. #4
    Senile Half-Wit Freaky Chris's Avatar
    Join Date
    Mar 2009
    Posts
    834
    My Mood
    Cynical
    Thanks
    7
    Thanked 105 Times in 90 Posts

    Default Re: creating a controller to allow instances to be created from keyboard

    import java.util.Scanner;
    ...
     
    Scanner sIn = new Scanner(System.in);
     
    String name = sIn.nextLine();

    You get the idea??

  5. #5
    Junior Member
    Join Date
    Oct 2009
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: creating a controller to allow instances to be created from keyboard

    i dont really understand how to progress with that...

    would it help if i showed you one of my classes so you can start me off with an example?

Similar Threads

  1. how to know user pressed a key in the keyboard
    By cilang in forum File I/O & Other I/O Streams
    Replies: 16
    Last Post: September 11th, 2009, 10:08 AM
  2. How do I fix my program so I can use the keyboard to type in the numbers?
    By rocafella5007 in forum File I/O & Other I/O Streams
    Replies: 1
    Last Post: April 29th, 2009, 02:39 PM
  3. [SOLVED] Program to read from created file
    By aznprdgy in forum File I/O & Other I/O Streams
    Replies: 3
    Last Post: April 7th, 2009, 03:51 AM
  4. How can i control keyboard through programming?
    By Mohd in forum Java Theory & Questions
    Replies: 3
    Last Post: January 5th, 2009, 07:10 AM