Java for Complete Beginners (Video), Part 41: Writing Text Files

A tutorial on writing text files, Java 7 style. If you want Java 6 style, you can easily take the code here and re-arrange it along the lines of the previous tutorial on reading text files in Java. Writing text … Continue reading

Posted in Java, Java Video Tutorials (Beginners) | Tagged , , , , , , , |

Java for Complete Beginners (Video), Part 40: Try With Resources

Java 7 introduces a great new language feature, “try with resources”. In this tutorial we’ll see how we can use a try block to simply our file reading code quite a lot, ensuring that file handles are closed without the … Continue reading

Posted in Java, Java Video Tutorials (Beginners) | Tagged , , , , , , , |

Java for Complete Beginners (Video), Part 39: Reading Files with FileReader

The most flexible way to read files in Java involves using a sort of Russian doll system of objects; in this tutorial we’ll look at reading text files using such a method. Unfortunately prior to Java 7 we end up … Continue reading

Posted in Java, Java Video Tutorials (Beginners) | Tagged , , , , , |

Java for Complete Beginners (Video), Part 38: Abstract Classes

Abstract classes allow you to define the parent class of a new hierarchy without having to worry about the user actually instantiating the parent. For instance you could create an “Animal” class just to act as the basis for “Dog”, … Continue reading

Posted in Java, Java Video Tutorials (Beginners) | Tagged , , , , , |

Java for Complete Beginners (Video), Part 37: Runtime Exceptions

Runtime exceptions are a kind of exception that you’re not forced to handle. They usually point to serious problems with your code, indicating that you need to revise it. The infamous null pointer exception and array out-of-bounds exception are good … Continue reading

Posted in Java, Java Video Tutorials (Beginners) | Tagged , , , , , |

Java for Complete Beginners (Video), Part 36: Multiple Exceptions

In this tutorial we’ll take a look at throwing and handling multiple exceptions, plus a look at a popular exam/interview question. Java 7 introduced a new way of handling multiple exceptions; but even if you’re still on Java 6, there … Continue reading

Posted in Java, Java Video Tutorials (Beginners) | Tagged , , , , |

Java for Complete Beginners (Video), Part 35: Throwing Exceptions

In this tutorial we’ll take a look at how to throw your own exceptions in Java. Throwing an exception is a useful thing to do when your method encounters an unexpected error; the exception will immediately return from your method, … Continue reading

Posted in Java, Java Video Tutorials (Beginners) | Tagged , , , , |

Java for Complete Beginners (Video), Part 34: Handling Exceptions

Exceptions are a major part of the Java language; so much so that you can’t write very much code without at least having to handle some of them. In this tutorial we’ll get started with Exceptions, and I’ll also give … Continue reading

Posted in Java, Java Video Tutorials (Beginners) | Tagged , , , , |

Java for Complete Beginners (Video), Part 33: Reading Files

You can use the Scanner class to simplify reading text files quite a bit. In this tutorial we’ll see how to do it, and I’ll also explain how to locate your file on the disk and we’ll look at a … Continue reading

Posted in Java, Java Video Tutorials (Beginners) | Tagged , , , |

Java File: Reading and Writing Files in Java

About File Handling in Java Reading Ordinary Text Files in Java Reading Binary Files in Java Writing Text Files in Java Writing Binary Files in Java About File Handling in Java One this page you can find a simple guide … Continue reading

Posted in Java | Tagged , , |

Perl File Open: Creating, Reading and Writing to Files in Perl

Dealing with files in Perl is very easy once you get used to the slightly odd syntax. Here are some examples to get you started. Open a File in Perl To open a file in Perl, just the open() subroutine. … Continue reading

Posted in Perl | Tagged , , |