background preloader

JAVA

Facebook Twitter

Java I/O Tutorial. Java comes with many handy I/O classes to support the input and output through bytes stream and file system.

Java I/O Tutorial

Here’s a list of the Java I/O examples including file, temporary file and directory manipulation, encoding, serialized and also compression with zip or Gzip. Happy learning Java I/O :) File List of the File examples to show the use of Java I/O to create, read, write, modify file and get the file’s information. File Serialization Take any object that implements the Serialization interface, convert it into bytes and store it into file; The file can be fully restore back to the original object later. File Compression File compression examples, ZIP and GZip. Course: Welcome to Java. Reading and writing text files. In JDK 7, the most important classes for text files are: Paths and Path - file locations/names, but not their content.

Reading and writing text files

Files - operations on file content. StandardCharsets and Charset (an older class), for encodings of text files. the File.toPath method, which lets older code interact nicely with the newer java.nio API. In addition, the following classes are also commonly used with text files, for both JDK 7 and earlier versions: Scanner - allows reading files in a compact wayBufferedReader - readLineBufferedWriter - write + newLine When reading and writing text files: it's often a good idea to use buffering (default size is 8K)there's always a need to pay attention to exceptions (in particular, IOException and FileNotFoundException) Character Encoding In order to correctly read and write text files, you need to understand that those read/write operations always use an implicit character encoding to translate raw bytes - the 1s and 0s - into text.

Database « Java Tutorial. Date / Time Example Java code example - Click here to copy ->>> JavaScript. A Rocket Stove Made From a Five Gallon Metal Bucket. The principle behind a rocket stove is simple–rather than cooking on an open fire, you burn wood in an insulated chimney.

A Rocket Stove Made From a Five Gallon Metal Bucket

Rocket stoves are highly efficient and easy to make. They run on twigs, so you can avoid cutting down a whole tree just to cook dinner. We’ve had a rocket stove made out of brick in our backyard for several years. The post we wrote on it in 2007 is–oddly–the most frequently searched post on this site. I figured that since there was so much interest in the topic it would be good to offer one that didn’t require masonry work. Using a piece of 4″ vent pipe and a 90º elbow, I made the chimney. I traced the outline of the vent pipe on to the lid of the bucket and cut this hole out with a jig saw.

Using the vent pipe as a guide again, I cut out a 4″ hole near the bottom of the bucket. I used one part clay (harvested from the yard) to six parts vermiculite as my insulation material. I found a barbecue grill at Home Depot that rests on the top of the bucket to support a pot. JavaScript if...else Statement. Advertisements While writing a program, there may be a situation when you need to adopt one path out of the given two paths.

JavaScript if...else Statement

So you need to make use of conditional statements that allow your program to make correct decisions and perform right actions. JavaScript supports conditional statements which are used to perform different actions based on different conditions. Here we will explain if..else statement. JavaScript supports following forms of if..else statement: if statementif...else statement if...else if... statement. The if statement is the fundamental control statement that allows JavaScript to make decisions and execute statements conditionally.

Syntax: Here JavaScript expression is evaluated. Example: This will produce following result: To understand it in better way you can Try it yourself. The if...else statement is the next form of control statement that allows JavaScript to execute statements in more controlled way. Here JavaScript expression is evaluated. Tutorials - Advanced C, C++, Graphics, Computer Science Tutorials. C++ tutorials, OpenGL with C++ tutorials, Standard Template Library (STL) tutorials, articles on programming and computer science, as well as Denthor of Asphyxia's graphics tutorials converted to C++.

Tutorials - Advanced C, C++, Graphics, Computer Science Tutorials

Please email me with corrections or submissions to this page. Would you like to use these tutorials on your site? Information for those of you having trouble keeping your program open. subscribe to updates via RSS. AI Tutorials Perceptrons Learn about a simple way to simulate neuronsMiniMax Game Trees Learn about coding a decision-making programChess Board Representation Learn about efficient chess board representations OpenGL Tutorials by RoD Understanding Floating Point Numbers by Jeff Bezanson Every programmer should understand enough about floating point numbers to avoid the pitfalls of assuming perfect precision.