Results 1 to 2 of 2
  1. #1
    busyspider is offline Member
    Join Date
    Jan 2013
    Rep Power

    Default how to instantiate a ConsoleProgram in java

    I want to use the method "println" in ConsoleProgram to print a sentence.

    I was trying to instantiate ConsoleProgram , program and use the object program to call this method.

    Did I do the write thing? it doesn't work and I don't know why. THank you!

    import acm.program.*;

    public class printex {
    public void run(){
    ConsoleProgram program = new ConsoleProgram();
    program.println("This program lists the Fibonacci sequence");
    int Fib0=0;
    int Fib1=1;}

  2. #2
    PhHein's Avatar
    PhHein is offline Senior Member
    Join Date
    Apr 2009
    Rep Power

    Default Re: how to instantiate a ConsoleProgram in java

    I don't even know where to start. Have a look at these tutorials: Trail: Getting Started (The Java™ Tutorials)
    Complete list: The Java™ Tutorials
    Math problems? Call 1-800-[(10x)(13i)^2]-[sin(xy)/2.362x]
    The Ubiquitous Newbie Tips

Similar Threads

  1. How to instantiate Class, into jsp, java script
    By silvia in forum JavaServer Pages (JSP) and JSTL
    Replies: 2
    Last Post: 01-04-2014, 09:08 AM
  2. Cannot instantiate the type
    By JavaNovice1 in forum New To Java
    Replies: 1
    Last Post: 11-01-2011, 04:25 PM
  3. Cannot instantiate a type
    By Yeshol in forum Eclipse
    Replies: 14
    Last Post: 07-06-2011, 06:03 PM
  4. Error: ConsoleProgram cannot be resolved to the type
    By petrohamadi in forum New To Java
    Replies: 5
    Last Post: 06-13-2011, 11:49 PM
  5. help instantiate a java class that extend applet
    By geosa in forum Java Applets
    Replies: 0
    Last Post: 12-04-2010, 10:14 AM

Posting Permissions

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