Home | Contact Us | Log In | Help
  ASP.Net & C#
  Perl and PHP
  Java Scripts
  C and C++
  Ajax Tutorials
  J2ee, J2Me, Java
  Python & Ruby Rail
  Crystal Report
  Cold Fusion & CFML
  Photoshop/Web Designing
  Tools & Utilities
  Sql Server
  Domain Name Registration
  Remotely Hosting
  Web/Server Application
  Hotel Marketing
  Internet and Law
   Search Engine Optimization/SEO
Interview Questions
Previous< 1 2 3 4 5 > Next
First Java Program

You have downloaded and installed the J2SDK. You have run the demo applications. Now you are ready to write, compile, and execute your first Java program. Writing a Hello World! program is the traditional first step taken when learning a new language. It allows you to take the new language and its development tools through a test-drive, stepping through the complete install, edit, compile, and run cycle without getting bogged down in language details (plenty of that later).

File Input Output

Input/output operations route data from the keyboard, files or programs into your program and from there to the screen, printer, files or other programs. For simple tasks such as dumping your output to a file or printer or using a text file as an input script simple redirection provided by the operating system is all that is required. Our previous tutorials have used System.in and System.out objects to read and write from the standard input and output streams.

Exploration testing db4o

Exploring this area of db4o is a tricky undertaking and gives me the opportunity to show off a tactic taught to me by good friend: exploration tests. (Thanks to Stu Halloway, who first coined the phrase, as far as I know.) An exploration test, in a nutshell, is a series of unit tests written not only to test the library in question, but also to explore the API and ensure that the library behaves the way it is expected to. As a useful side-effect of this approach, future library versions can then be dropped into the exploration test code, compiled, and tested. If the code doesn't compile or the exploration tests don't all pass, then the library is clearly not backward-compatible, and you will find out before ever trying to use it in a production system.

File Management

File management is the manner in which files are monitored and controlled for standard I/O access. The File class provides a constructor to create a file handle. This file handle is then used by various file class methods to access the properties of a specific file or by file stream constructors to open files. The File class also provides appropriate platform dependent directory and file separator symbol (slash or backslash) using either File.separator or File.separatorChar. Simple file constructors either use hardcoded names or pass a value from the parameter line such as:

Random Access Files

Random access files allow files to be accessed at a specific point in the file. They can also be opened in read/write mode which allows updating of a current file. The constructor is RandomAccessFile(File fileObject, String accessMethod) where the access method is either "r" or "rw". The seek(long position) method moves the file position pointer. It is incremented automatically on a write. The getFilePointer() method returns the current file position pointer. The file size can be adjusted with setLength(). Normal i/o methods are used for access.

Previous< 1 2 3 4 5 > Next
  Copyright 2000-2006 © SoloScript.com, All rights reserved.