Results 1 to 6 of 6
  1. #1
    El_Davidos is offline Member
    Join Date
    Nov 2010
    Posts
    4
    Rep Power
    0

    Post Need help with some questions

    Problem Set 1A
    1. The sample programs for Unit 1. If you have not already done so, copy from the shared drive the sample programs Welcome1.java, WelcomeDialog1.java, WelcomeDialog2.java, HealthWarning.java. Open them in JCreator, compile and run each one, then answer the following questions:

    (i) What object is being used for output in Welcome1.java? Welcome to OOP2
    (ii) What method is being called / invoked on it? Scanner
    (iii) What is the name of the method being used for output in WelcomeDialog1.java? System.out.Print
    (iv) This is a ‘static’ method, ie no object is needed for it: in what class is its definition?
    (v) How many arguments are passed to the output method in WelcomeDialog1?
    (vi) Run HealthWarning.java. In what way is the output different from the output from WelcomeDialog1?
    (vii) Examine the code for HealthWarning: how many arguments are passed to the output method?



    this is the code:
    public class Welcome1 {
    /** Displays a welcome message */
    public static void main( String args[] ) {
    System.out.println( "Welcome to OOP2" );
    }
    }
    Last edited by El_Davidos; 11-23-2010 at 09:58 AM. Reason: incomplete

  2. #2
    El_Davidos is offline Member
    Join Date
    Nov 2010
    Posts
    4
    Rep Power
    0

    Default

    when this is the example:
    public class Welcome1 {
    /** Displays a welcome message */
    public static void main( String args[] ) {
    System.out.println( "Welcome to OOP2" );
    }
    }

  3. #3
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    Welcome to the forum. So you've posted your homework assignment without actually asking a question, and it always confuses me what to do in this situation. Certainly you don't want someone to just post the answers for you to copy and hand in as that would be cheating, but I still have to wonder, just what do you want? Please help clarify this by showing us your attempted answers to these questions and any specific questions you may have regarding your answers.

  4. #4
    El_Davidos is offline Member
    Join Date
    Nov 2010
    Posts
    4
    Rep Power
    0

    Default

    alright so never mind Q4. these are my answers:
    (i) What object is being used for output in Welcome1.java? System.out.print
    (ii) What method is being called / invoked on it?
    (iii) What is the name of the method being used for output in WelcomeDialog1.java?
    (iv) This is a ‘static’ method, ie no object is needed for it: in what class is its definition?
    (v) How many arguments are passed to the output method in WelcomeDialog1? 1
    (vi) Run HealthWarning.java. In what way is the output different from the output from WelcomeDialog1? The output screen has a header in this example, “Health Warning”

  5. #5
    El_Davidos is offline Member
    Join Date
    Nov 2010
    Posts
    4
    Rep Power
    0

    Default

    actually i got it sorted. was a bit confused for a bit cos of way questions looked

  6. #6
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    I'm not seeing answers for many of your questions above. And we haven't seen the code for WelcomeDialog1 yet.

    The answer for (i) though were I do see an attempt is: System.out, a PrintStream object.

Similar Threads

  1. Three questions
    By an24 in forum JavaServer Faces (JSF)
    Replies: 0
    Last Post: 09-15-2010, 08:36 AM
  2. Some Questions
    By MuslimCoder in forum New To Java
    Replies: 2
    Last Post: 02-25-2009, 04:01 PM
  3. I have Questions -_-
    By ChazZeromus in forum New To Java
    Replies: 5
    Last Post: 09-13-2008, 08:08 PM
  4. Questions About JSP?
    By mtz1406 in forum JavaServer Pages (JSP) and JSTL
    Replies: 2
    Last Post: 08-19-2008, 07:56 PM
  5. Just a Few Questions
    By pringle in forum New To Java
    Replies: 21
    Last Post: 01-09-2008, 06:21 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •