Search Tutorials:
About Me
|
Contact Me
Home
Tutorials
ASP.NET
Android
AJAX
JQuery
WCF
Visual C#
ADO.NET
.NET Framework
LINQ
Visual Basic
Java
HOW TOs
ASP.NET
Android
AJAX
JQuery
Visual C#
ADO.NET
.NET Framework
LINQ
Visual Basic
Java
Blog Posts
ASP.NET
JavaScript
Android
JQuery
Visual C#
.NET Framework
Visual Studio
ASP.NET MVC
Windows Phone 7
Free ebooks
Book Reviews
General
Personal
Presentations
Cheat Sheets
Web Services
Java Tutorials
Tweet
Share
|
Java
Singleton Design Pattern in Java
Posted by
Waqas Anwar
on
25 Apr 2008
- Views Count:
3607
When we write java applications, sometimes it is appropriate to have only one instance of a class. Windows Managers, Login and Dialog boxes etc are few examples of such classes. The Singleton design pattern solves this common problem and ensures that the class has only one instance. This also provides global point of access to the object.
Java
Copying Text based Files in Java
Posted by
Waqas Anwar
on
08 Apr 2008
- Views Count:
2722
Java IO Package provides two streams we can use to read and write all types of files including images, audio, video or even text files. These classes are FileInputStream and FileOutputStream. In the following tutorial, I will show you how you can use these classes to read and write image file.
Java
Writing Text Files in Java using FileWriter class
Posted by
Waqas Anwar
on
07 Apr 2008
- Views Count:
4225
Java IO package provides FileWriter class which developers can use to write contents in disk file as a sequence of characters. The constructor of the class requires file path and creates automatically if it does not exist depending on the user operation system security settings.
Java
Reading Text based Files in Java
Posted by
Waqas Anwar
on
06 Apr 2008
- Views Count:
2796
The Java IO package provides FileReader class to read contents of a text based file such as txt, html or XML. The most common method to read text file in java is to call read method of FileReader class in the loop and continuously check the return byte of the read method. Read method returns -1 when it reaches at the end of the file and there are no contents to read. However, you must need to keep in mind that read method throws FileNotFoundException if the file you are trying to read does not exist. It also throws IOException if there is any other IO related error during the file reading process.
Java
Reading Console Input in Java
Posted by
Waqas Anwar
on
06 Apr 2008
- Views Count:
6799
Reading console input in simple java console applications is a very straight forward process. Java provides developers two predefined streams in the java.lang.System class to read and write data to and from standard input and output devices. System.out is a standard output stream which is Console by default and System.in is predefined input stream which is Keyboard by default. To read user input in a console window we connect system.in with other stream classes available in java.io package.
Java
Creating and Using Enums in Java
Posted by
Waqas Anwar
on
13 Mar 2008
- Views Count:
10302
In J2SE 5.0 Java introduced typesafe enumerations called “Enum” or simply “enums”. They are used to create multiple constants with a single given name.
Find us on Facebook
Popular Posts
Binding Android ListView with Custom Objects using ArrayAdapter
August 12, 2011
Using Parameters with ObjectDataSource Control
June 24, 2009
Editing ASP.NET ListView Control using JQuery AJAX and Web Services
December 16, 2010
Editing Data using ASP.NET GridView Control
April 11, 2009
Insert Records using ObjectDataSource Control
June 27, 2009
Recent How TOs
How to Change IFrame Source using JQuery
November 14, 2012
How to Set Files as Read Only in .NET
August 29, 2012
How to get Domain Controllers Information in .NET
August 29, 2012
How to Check Validity of IP Address in .NET
August 29, 2012
How to Ping an IP Address in .NET
August 29, 2012
How to Create Conditional method
August 29, 2012
How to Create Breakpoint programmically
August 29, 2012
Recent Blog Posts
Add Conversations to Any Site with Moot Forums
May 20, 2013
Create Free Responsive Portfolio Websites with Dunked
May 16, 2013
Ghost: A Revolutionary Open Source Blogging Platform
May 16, 2013
A Fast & Fully Featured Auto-Complete Library
April 27, 2013
Paragraph, Word & Character Counting with Countable.js
April 27, 2013
Tags
asp.net
.net framework
ajax
android
visual basic
java
visual c#
linq
wcf
jquery
ado.net