Home Discussion Discuss: Using a Random Access File in Java

  • Small error, confusing in-code commentAustin July 27, 2012 at 9:34 PM

    In the comment above the call to the RandomAccessFile constructor, it says that it opens the file for both reading and writing. That confused me because the call to the constructor only had "r" in the second argument instead of "rw". I just recently learned about random access files, so that's why i found it so confusing. Anyway, I just wanted to point it out so no one else who is fairly new to java gets confused.

Post your Comment



Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 
Related Articles
Java Beginners

Random Access File class
Random Access File class  Write a short note on Random Access File class.   Please visit the following link: Java Random Access File 

Java Beginners

Random Access File.
Random Access File.  Explain Random Access File 

Java Interview Questions

RANDOM ACCESS FILE CONCEPT
RANDOM ACCESS FILE CONCEPT  In a random access file, first write the alphabets a,b, c, d till z. Read the file in reverse order and print it on screen 

Java Interview Questions

RANDOM ACCESS FILE CONCEPT
RANDOM ACCESS FILE CONCEPT  Write a program that stores the names of four employees in an array of strings. Store the contents of the array in an alphabetical order in a file and display it back on console. Do not use 

Java Interview Questions

RANDOM ACCESS FILE CONCEPT
RANDOM ACCESS FILE CONCEPT  Write a program to use a File object and print even numbers from two to ten. Then using RandomAccessFile write numbers from 1 to 5. Then using seek () print only the last 3 digits 

Java Beginners

RANDOM ACCESS FILE CONCEPT
RANDOM ACCESS FILE CONCEPT  Write a program to write the details of an employee to a file. Details such as year of joining, department code... and display it on the console. Using the seek pointer, retrieve the employee name 

Java-Tutorials

Using a Random Access File in Java
the characters from a file using the readByte( ) method...: C:\nisha>java ReadAccessFile Enter File name : Filterfile.txt...C:\nisha>javac RandAccessFile.java C:\nisha>java 

Java Beginners

random pass generator - Java Beginners
random pass generator  Write a program (name the program and class... in a data file called passwords.dat. Download a data file, names.dat, containing... this data file in the same folder as your program and other data file. Your 

Java Beginners

getting random number in java
access to random class in java Created the object of Random class like - Random...getting random number in java  getting random number in java Hi... random numbers between 1 to 100 in Java. Though i m new to Java, i have tried many 

JSP Servlet Questions

Random Creation of password
to be encrypted and then send to the database.....I am using jsp as my front end and java has my back end,....My database is Ms Access...my problem is that i am not able...Random Creation of password  Dear Sir I have created a form with some 

Java Technology Tutorials

How to use random access file
How to use random access file In this section, you will learn the use... is used for both reading and writing files. A random access file treats...() method- It closes the random access file stream. writeBytes( ) method 

RMI Questions

ls: cannot access >: No such file or directory
ls: cannot access >: No such file or directory  import.../f.txt from terminal in linux its creating f.txt.But cant run from java program ls: cannot access >: No such file or directory error is displayed .No f.txt 

Java Beginners

Random data - Java Beginners
Random data  hi friend, I want to ask how to make random data. i has example word like this : Gaza! Gaza! Palestina merdeka! how to make random like : Azag! Azag! Anitselap akedrem! thank's 

Java Beginners

random numbers - Java Beginners
random numbers  write a program to accept 50 numbers and display 5... java.util.*; class RandomNumberExample { static Random generator = new Random...(); System.out.println("Random numbers are: "); int random[]=new int[5]; for(int i=0;i 

Java Tips and Examples

switch Example - Random Insults
Java Notesswitch Example - Random Insults The following class could be useful for generating random insults in response to erroneous user input... // File : 1java/textgen/TestTextGenerator1.java // Purpose: Show some random 

Java Beginners

random numbers - Java Beginners
random numbers  Hello i need this code to be modified for me to display the random numbers, but not twice or more. I mean i need a number... RandomNumberExample { static Random generator = new Random(); public static int get (int[] array 

Java Beginners

Generating random numbers in a range with Java
Generating random numbers in a range with Java  Generating random numbers in a range with Java 

Java Tips and Examples

Random numbers - Introduction
Java NotesRandom numbers - Introduction When to use random numbers There are many types of programs that use random numbers. Game programs use them... situation, or a deck of cards must be shuffled. Simulations usually use random 

Java Beginners

Random Number Generation - Java Beginners
Random Number Generation  Can any one tell me about to generate integers that should be a 10 numbered integer. Should be between 100000000 to 9999999999. Core Application  Hi friend, Code to solve the problem 

JSP Servlet Questions

web page access
" and project code = "Java Server Page" "HOW TO WRITE CODE CLIENT ACCESS SERVER...web page access  I was store project in server and i will open that project file in client side add="http://server:8080/project..." this is very 

JDBC Questions

MS Access - JDBC
information about MS access database...but still i am having doubt in that topic. My problem is : Is there any jar to connect MS Access and java ... because..... waitin for your reply..  no need to upload jar file for msaccess is just 

JSP Servlet Questions

understanding buttons :JSP random no program
understanding buttons :JSP random no program  I hav java random... "no is greater" please help me to understand buttons .thank you java code for random... random no between 100 and 200 on loading and on clicking submit button it ives 

Java Tips and Examples

Random Numbers - shuffling
Java NotesRandom Numbers - shuffling A standard approach to shuffling the elements of an array is to write some code as described below. As of Java 2... is described at the bottom. Shuffling: Random numbers without replacement 

Java Beginners

Package Access Specifier - Java Beginners
Package Access Specifier  Hello Friends, I have created a Pkg named BCA , iN this Package i declare two classes name : - Test Class & House Class House is the Public Class I saved it with House.java File 

Java Beginners

Upload file to MS Access
Upload file to MS Access  Iam beginner and need to upload file to msaccess using jsp . Iam using netbeans platform. Kindly explain do I need to mention Attachment format in the table 

Java Beginners

generating random numbers - Java Beginners
generating random numbers  We would like to be able to predict tomorrow's price of a share of stock. We have data on past daily prices. Based... and the price.We will evaluate a possible weighting by using it to predict each 

JDBC Questions

how to store image file and videofile in ms access database using java? - JDBC
how to store image file and videofile in ms access database using java?  how to store image file and video file in ms access database using java 

Java Technology Tutorials

Generate random numbers in Java
Generate random numbers in Java - How to use the java.util.Random class to generate desired random number in Java program? In this tutorial I will teach you how to write Java code using the java.util.Random class to generate single 

Java-Tutorials

Generating Random Number
requirements. Java provides classes to help you in generation random numbers... understand and use the code to generate random numbers in your java application... is used to create a random number through it's created object using the 48-bit 

SQL Question

why it is very slow when I am using the backend as microsoft access file for running the java webapplication - SQL
why it is very slow when I am using the backend as microsoft access file for running the java webapplication  I am using the backend as microsoft access file for running the java webapplication.it is very slow when twoor mor 

DMCA.com