Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / First Aid / February 2004

Tip: Looking for answers? Try searching our database.

I/O problem

Thread view: 
Bob Stroomer - 26 Feb 2004 14:47 GMT
Hi everybody,
I got a question about I/O classes

At school, we have to type for the input/output:

Input in;
Output out;

And in the constructor:

in = new Input()
out = new Output()

I understand how this works.
But now I want to run and compile java-programmes at home. I installed
the sun java sdk kit. And the compiler gives four errors for the
declaration of the input and output class. (Input and Output are
unknown classes)
How can I solve this problem?
Grtz,
Bob
Andrew Thompson - 26 Feb 2004 15:00 GMT
> Hi everybody,
> I got a question about I/O classes
[quoted text clipped - 14 lines]
> declaration of the input and output class. (Input and Output are
> unknown classes)

?? or perhaps..
"cannot resolve symbol"

> How can I solve this problem?

Quote the exact message you get.

It seems your school is using some
custom classes to make I/O easier
(Input and Output are not classes
of the core API) - you need to
import them.  Something like

import java.net.URL;

Signature

Andrew Thompson
* http://www.PhySci.org/ Open-source software suite
* http://www.PhySci.org/codes/ Web & IT Help
* http://www.1point1C.org/ Science & Technology

Andrew Hobbs - 27 Feb 2004 00:26 GMT
> Hi everybody,
> I got a question about I/O classes
[quoted text clipped - 17 lines]
> Grtz,
> Bob

As another Andrew pointed out, your school has provided custom classes to
make your job of learning the java basics easier.  What you need to do now
is come to grips with the standard input and output classes so that you are
not reliant on them.  You need to consider what sort of input and output you
want in any particular situation.

Have you discovered the Sun tutorials yet.

http://java.sun.com/docs/books/tutorial/

They are a great resource and have basic tutorials and information on just
about every aspect of java you will ever need.

In your case if you need to input from and output to disc then you could
look at this tutorial

http://java.sun.com/docs/books/tutorial/essential/io/index.html

If you want I/O via the screen and a GUI then try this

http://java.sun.com/docs/books/tutorial/uiswing/index.html

Cheers

Andrew

--
********************************************************
Andrew Hobbs   PhD

MetaSense Pty Ltd     -    www.metasense.com.au
Australia

61 8 9246 2026
metasens AntiSpam @iinet dot net dot au

*********************************************************
GoGoGoGo - 29 Feb 2004 15:32 GMT
001    package examples.util;
002
003    import java.io.File;
004
005    import org.osdk.util.FileIO;
006
007    /**
008     * Examples for using the FileIO class.
009     *
010     * @license  Released under the <a
href="http://www.opensource.org/licenses/lgpl-license.php" >
011     *   Lesser GNU Public License (LGPL).</a>
012     *   Please refer to the license.txt or the previous
link the LGPL at www.opensource.org.
013     * @copyright (c) 2003  <a href="http://www.osdk.com"
>Open Source Developer's Kit</a>.  All rights reserved.
014     * @organization Open Source Developer's Kit
015     * @author Scott Wheeler
016     * @version 0.6
017     * @todo
018     * @history
019     */
020
021    public class FileIOExample {
022
023
024
025      public FileIOExample () {
026
027      }
028
029
030        /**
031         *
032         */
033        public void getDirectoryFiles()  {
034
035          FileIO  fileReader = null;
036          File[]  files = null;
037
038          try {
039
040             fileReader = new FileIO();
041             files =
fileReader.getDirectoryFiles("e:/lucene/documents", "",
true);
042
043             for (int i=0; i < files.length; i++) {
044
045
System.out.println(files[i].getAbsolutePath());
046             }
047
048          }
049          catch (Throwable e) {
050            e.printStackTrace();
051          }
052        }
053
054       public static void main(String[] args) {
055
056          FileIOExample fileIO = new FileIOExample();
057
058          fileIO.getDirectoryFiles();
059
060       }
061    }


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.