Quick Notes: SCJP 1.6 (Sun Certified Java Programmer)

This articel contains quick notes which I did during reading Sun Certified Programmer for Java 6 Study Guide - SCJP. Kathy Sierra, Bert Bates.

Also it was extended with some additional notes from official Java doc API which are not required for SCJP 6.

If you gonna pass SCJP exam - it will be the best crib.
  

1         DECLARATION & ACCESS CONTROL

1.1     Ranges of Numeric Primitives

Type
Bits
Bytes
Min. Range
-2(bits-1)
Max. Range
2(bits-1)-1
byte
8
1
-27
27-1
short
16
2
-215
215-1
int
32
4
-231
231-1
float
32
4
n/a
n/a
long
64
8
-263
263-1
double
64
8
n/a
n/a

1.2       Comparison of modifiers on variables vs. methods

Local
Variables
Non-local
Variables
Methods
final
final
public
protected
private
static
transient
volatile
final
public
protected
private
static

abstract
synchronized
strictfp
native

1.3       Enumerations

  • An enum can be declared outside or inside a class but not in a method
  • An enum declared outside a class must not be marked static, final, abstract, protected or private
  • An enum can implement any interface
  • Enums can contain constructors, methods, variables and constant class bodies
  • Enum constructors can never be invoked directly in code
  • MyEnum.values() returns an array of MyEnum’s values

2       OBJECT ORIENTATION

2.1     Overriding

  • Appear in subclasses
  • Have the same name as a superclass method
  • Have the same parameter list as a superclass method
  • Have the same return type as a superclass method
  • The throws clause of the overriding method may only include exceptions that can be thrown by the superclass method, including its subclasses
  • The access modifier for the overriding method may not be more restrictive than the access modifier of the superclass method:
    • if the superclass method is public, the overriding method must be public
    • if the superclass method is protected, the overriding method may be protected or public
    • if the superclass method is package, the overriding method may be packageprotected, or public
    • if the superclass methods is private, it is not inherited and overriding is not an issue

2.2     Overloading

  • Overloaded methods must change the argument list
  • Overloaded methods can change the return type
  • Overloaded methods can change the access modifier
  • Overloaded methods can declare new or broader checked exceptions

2.3     Coupling

  • Coupling refers to the degree to which one class knows about or uses members of another class
  • Loose coupling is the desirable state of having classes that are well encapsulated, minimize references to each other, and limit the breadth of API usage
  • Tight coupling is the undesirable state of having classes that break the rules of loose coupling

2.4     Cohesion

  • Cohesion refers to the degree in which a class has a single, well-defined role or responsibility
  • High cohesion is the desirable state of a class whose members support a single, well-focused role or responsibility
  • Low cohesion is the undesirable state of a class whose members support multiple, unfocused roles or responsibilities

3       ASSIGMENTS

3.1     Initialization rules

  • Init blocks execute in the order they appear
  • Static init blocks run once, when the class is first loaded
  • Instance init blocks run every time a class instance is created
  • Instance init blocks run after the constructor’s call to super()

3.2     Boxing

  • Primitive widening uses the “smallest” method argument possible
  • Used individually, boxing and var-args are compatible with overloading
  • You cannot widen and then box (int can’t become Long)
  • You cannot widen from one wrapper type to another (IS-A fails)
  • You can box and then widen (int can become an Object via Integer)
  • You can combine var-args with either widening or boxing

4       OPERATORS

4.1     Bit Shift Operators

Operation
Meaning
Example
>>> 
unsigned shift operator
1011 >>> 1 = 0101
>>, <<
signed shift operator
1011 >> 1 = 1101

5       FLOW CONTROLS

5.1      Exceptions


Picture #5.1 – Hierarchy of Java Exceptions.

5.2     Assertions

5.2.1    Identifier vs. Keyword

  • To use assert as identifier compile code with:
    • javac -source 1.3 *.java
  • To use assert as keyword compile code with:
    • javac -source 1.4/1.5/5/1.6/6 *.java

5.2.2    Assertion Rules

  • Don’t use assertions to validate arguments to a public method
  • Don’t use assertions to validate command-line arguments
  • Don’t use assert expressions that can cause side effects
  • Do use assertions to validate arguments to a private method
  • Do use assertions, even in public methods, to check for cases that you know are never, ever supposed to happen

6       STRINGS,  I/O,  FORMATTING,  PARSING

6.1      String

  • intern() - when the intern method is invoked, if the pool already contains a string equal to this String object as determined by the equals(Object) method, then the string from the pool is returned. Otherwise, this String object is added to the pool and a reference to this String object is returned. It follows that for any two strings s and t,s.intern() == t.intern() is true if and only if s.equals(t) is true.
  • substring(start, end) - returns a new string that is a substring of this string [start, end)

6.2     StringBuffer & StringBuilder

  • StringBuilder & StrignBuffer are identical in functionality but StringBuilder isn’t thread safe
  • substring(start, end) - returns a new string that is a substring of this string [start, end)
  • equals() – is not overridden; it doesn’t compare values

6.3     Console

Example:
  1 //Get a Console
  2 java.io.Console c = System.console();
  3            
  4 //Read string
  5 String input1 = c.readLine();
  6 String input2 = c.readLine("%s", "input string");
  7            
  8 //Read password
  9 char password[];
 10 password = c.readPassword();
 11 password = c.readPassword("%s", "input password");

6.4     Serialization

  • If a superclass implements Serializable, then its subclasses do automatically
  • If a superclass doesn’t implement Serializable, then when a subclass object is deserialized, the superclass constructor will be invoked, along with its super constructor(s)
  • If a class has object reference to another class that doesn’t implement Serializable the runtime exception will be thrown – java.io.NotSerializableException
  • Serialization is not for Statics

6.5     Dates, Numbers, Currency

Class
Key Instance Creation Options
util.Date
new Date();
new Date(long millisecondsSince01011970);
util.Calendar
Calendar.getInstance();
Calendar.getInstance(Locale);
util.Locale
Locale.getDefault();
new Locale(String lang)
new Locale(String lang, String country)
text.DateFormat
DateFormat.getInstance();
DateFormat.getDateInstance();
DateFormat.getDateInstance(style);
DateFormat.getDateInstance(style, Locale);
text.NumberFormat
NumberFormat.getInstance();
NumberFormat.getInstance(Locale);
NumberFormat.getNumberInstance();
NumberFormat.getNumberInstance(Locale);
NumberFormat.getCurrencyInstance();
NumberFormat.getCurrencyInstance(Locale);

6.6      Regular expressions

Metacharacter
Meaning
\d
A digit: [0-9]
\D
A non-digit: [^0-9]
\s
A whitespace character: [ \t\n\x0B\f\r]
\S
A non-whitespace character: [^\s]
\w
A word character: [a-zA-Z_0-9]
\W
A non-word character: [^\w]
.
Any character

Greedy Quantifier
Meaning
*
Zero or more occurrences
?
Zero or one occurrences
+
One or more occurrences
{n}
Exactly n times
{n,}
At least n times
{n,m}
At least n but not more than m times

6.7      Tokenizing

Example:
  1 String str = "Monday,Tuesday,,Thursday,Friday";
  2            
  3 //String split
  4 String[] tokens = str.split(",");         // [Monday,Tuesday,,Thursday,Friday]
  5 int count = tokens.length;                // count = 5
  6            
  7 //StringTokenizer
  8 StringTokenizer tokenizer = new StringTokenizer(str, ",");
  9 int count3 = tokenizer.countTokens();     //count = 4
 10 while (tokenizer.hasMoreTokens()) {
 11       System.out.print(tokenizer.nextToken() + " ");
 12 }                                         // [Monday,Tuesday,Thursday,Friday]

6.8     Formatting

%[arg_index$] [flags] [width] [.precision] conversion char
arg_index
an integer followed directly by a $, this indicates which argument should be printed in this position
flags
“-”      – left justify this argument
“+”     – include a sign (+ or -) with this argument
“0”      – pad this argument with zeroes
“,”      – use locale-specific grouping separators
“(”      – enclose negative numbers in parentheses
width
indicates the minimum number of character to print
precision
indicates the number of digits to print after the decimal point
conversion
b          – boolean
c        – char
d        – integer
f         – floating point
s        – string


7       GENERICS & COLLECTIONS

7.1     Class hierarchy for collections

Picture #7.1 – Hierarchy of Java Collections

7.2     Collections details

Class
Common Features
Individual Features
ArrayList
·   ordered by index position
·   unsorted
·   could have null elements
·  fast iteration
·  fast random access
Vector
·  thread safe
LinkedList
·  fast insertion
·  fast deletion
·  peek() - retrieves, but does not remove, the head (first element) of this list
·  poll() - retrieves and removes the head (first element) of this list
·  offer() - adds the specified element as the tail (last element) of this list
PriorityQueue

·  ordered by natural order
·  could NOT have null element
·  first in first out
HashSet
·  doesn’t allow duplicates

·  unsorted
·  unordered
·  could have null elements
LinkedHashSet
·  ordered
·  could have null elements
TreeSet
·  sorted
·  can’t have null elements
·  ceiling(e) – returns the lowest element >= e, otherwise null
·  floor(e) - Returns the greatest element in this set less than or equal to the given element, or null if there is no such element.
Hashtable
·  unique identifiers
·   unsorted
·   unordered
·   doesn’t allow anything that’s have null
HashMap
·  unsorted
·  unordered
·  allows one null key
·  allows multiple null values
LinkedHashMap
·  ordered
·  allows one null key
·  allows multiple null value
TreeMap
·  ordered
·  sorted by natural order or custom
·  doesn’t allow null key
·  allows multiple null values
·  ceilingKey(key) – returns the lowest key >= key, otherwise null

java.lang.Comparable
java.util.Comparator
public int compareTo(T o)
public int compare(T o1, T o2)
Returns:
·   negative – if this object < anotherObject
·   zero – if this object =  anotherObject
·   positive – if this object > anotherObject
You must modify the class whose instances you want to sort.
You build a class separate from the class whose instances you want to sort.
Only one sort sequence can be created.
Many sort sequences can be created.
Implemented frequently in the API by:
String, Wrapper classes, Date, Calendar…
Meant to be implemented to sort instances of third-party classes.

java.util.Arrays
Description
static List asList(T[])
Convert an array to a List
static int binarySearch(Object[], key)
static int binarySearch(primitive[], key)
Search a sorted array for a given value,return an index or insertion point.
static int binarySearch (T[], key, Comparator)
Search a Comparator-sorted array for a value.
static boolean equals (Object[], Object[])
static boolean equals (primitive [],primitive [])
Compare two arrays to determine if their contents are equal.
static void sort (Object[])
static void sort (primitive[])
Sort the elements of an array by natural order.
static void sort (T[], Comparator)
Sort the elements of an array using a Comparator.
static String toString (Object[])
static String  (primitive[])
Create a String containing the contents of an array.

java.util.Collections
Description
static int binarySearch (List, key)
static int binarySearch (List, key, Comparator)
Search a “sorted” List for a given value,return an index or insertion point.
static void reverse(List)
Reverse the order of elements in a List.
static Comparator reverseOrder()
static Comparator reverseOrder(Comparator)
Returns a Comparator that sorts the reverse of the collection’s current sort sequence.
static void sort(List)
static void sort(List, Comparator)
Sort a List either by natural order or by a Comparator

8       INNER CLASSES

8.1     Class-Local Inner Class

8.1.1    Instantiating

To create an instance of an inner class, you must have an instance of the outer class to tie to the inner class.
Example:
  1 //Example#1
  2 MyOuter mo = new MyOuter();
  3 MyOuter.MyInner inner = mo.new MyInner();
  4            
  5 //Example#2
  6 MyOuter.MyInner inner = new MyOuter().new MyInner();

8.1.2    Member modifiers

Member modifies applied to inner classes:
  • final  
  • abstract      
  • public
  • private
  • protected
  • strictfp
  • static – for static nested class(not inner)

8.2     Method-Local Inner Class

8.2.1    Instantiating

  • method-local inner class can be instantiated only within the method where the inner class is defined
  • The inner class object can’t use the local variables of the method the inner class is in
  • local class declared in a static method has access to only static members of the enclosing class
Example:
  1 public class MyOuter {
  2    int b = 9;
  3    static int s = 9;
  4 
  5    [static] public void myFunc() {
  6       int a = 0;
  7      
  8       class MyInner {
  9          int add(int value) {
 10             value += a;       // Illegal use of local variable 'a'
 11             value += b;       // Legal use of member variable 'b'
 12             [value += s];     // Legal use of static variable 's'
 13             return value;
 14          }
 15       }
 16            
 17       MyInner mi = new MyInner();
 18       mi.add(5);
 19    }
 20 }

8.2.2    Member modifiers

  • The same rules apply to method-local inner classes as to local variable declarations, i.e. you can mark a method-local inner class as abstract or final, but never both at the same time

8.3     Anonymous

8.3.1    Instantiating

  • Inner class declared without any class name at all
  • A semicolon is required after declaration of anonymous class
  • Polymorphism is in play when anonymous inner class are involved
Example:
  1 class MyOuter {
  2       void myFunc() {
  3             System.out.println("MyOuter");
  4       }
  5 }
  6 
  7 class MainClass {
  8       MyOuter mo = new MyOuter() {
  9             void myFunc() {
 10                   System.out.println("Anonymous Class");
 11             }
 12       }; // WATCH OUT about semicolon!
 13      
 14       public void doIt() {
 15             mo.myFunc();      // Legal, MyOuter has a 'myFunc()'
 16             mo.newFunc();     // Not legal! MyOuter doesn't have a 'newFunc()'
 17       }
 18 }

8.4     Static Nested Class

8.4.1    Instantiating

  • The static nested class can be accessed without having an instance of the outer class
  • The static nested class doesn’t have access to the instance variables and non-static methods of the outer class
Example:
  1 class Outer {
  2       static abstract class Nested {
  3             abstract void doIt();
  4       }
  5 }
  6 
  7 class Runing {
  8       static int a = 0;
  9       int b = 0;
 10      
 11       public static void main(String[] args) {
 12             Outer.Nested on = new Outer.Nested() {
 13                   @Override
 14                   void doIt() {
 15                         System.out.println(a);  //OK
 16                         System.out.println(b);  //Not legal!
 17                        
 18                   }
 19             };
 20       }
 21 }

9       THREADS


9.1     Thread states

Picture #9.1

9.2     Class Thread

java.lang.Thread
public Thread()

public Thread(Runnable target)

public Thread(ThreadGroup group, Runnable target)

public Thread(String name)

public Thread(ThreadGroup group, String name)

public Thread(Runnable target, String name)

public Thread(ThreadGroup group, Runnable target, String name)

public Thread(ThreadGroup group, Runnable target, String name, longstackSize)

public final void wait()
Causes the current thread to wait until another thread invokes the notify() method or the notifyAll() method for this object.
public final native void notify()
Wakes up a single thread that is waiting on this object's monitor. If any threads are waiting on this object, one of them is chosen to be awakened. The choice is arbitrary and occurs at the discretion of the implementation. A thread waits on an object's monitor by calling one of the wait() methods.
public final native void notifyAll()
Wakes up all threads that are waiting on this object's monitor. A thread waits on an object's monitor by calling one of the wait() methods.
sleep(long millis)
            throws InterruptedException
sleep(long millisint nanos)
          throws InterruptedException
Causes the currently executing thread to sleep for the specified number of milliseconds. The thread does not lose ownership of any monitors.
yield()
Causes the currently executing thread object to temporarily pause and allow other threads to execute.
currentThread()
Returns a reference to the currently executing thread object.
interrupt()
Interrupts this thread.

Throws:
§  if the current thread cannot modify this thread
§  if this thread is blocked in an invocation of the wait() methods of the Object class, or of the join() or sleep(), methods of Thread class
§  if this thread is blocked in an I/O operation
§  if this thread is blocked in a Selector 
§  if none of the previous conditions hold
§  interrupting a thread that is not alive
join() throws InterruptedException
join(long millis)
    throws InterruptedException
join(long millisint nanos)
    throws InterruptedException
Waits at most millis milliseconds for this thread to die. A timeout of 0 means to wait forever.

Throws:
InterruptedException
§  if any thread has interrupted the current thread.
setContextClassLoader(ClassLoader cl)
Sets the context ClassLoader for this Thread. The contextClassLoader can be set when a thread is created, and allows the creator of the thread to provide the appropriate class loader to code running in the thread when loading classes and resources.
First, if there is a security manager, its checkPermission method is called with a RuntimePermission("setContextClassLoader") permission to see if it's ok to set the context ClassLoader.

Throws:
SecurityException
§  if the current thread cannot set the contextClassLoader.


9.3     Synchronization and Locks

Key points about locking and synchronization:
  • Only methods (or blocks) can be synchronized, not variables or classes
  • Each object has just one lock
  • Not all methods in a class need to be synchronized
  • Once a thread acquires the lock on an object, no other thread can enter any of the synchronized methods in that class
  • If a class has both synchronized and non-synchronized methods, multiple threads can still access the class’s non-synchronized methods
  • If a thread goes to sleep, it holds any locks it has – it doesn’t release them
  • A thread can acquire more than one lock
  • Static methods can be synchronized

10    DEVELOPMENT

10.1  Java & Javac 

Execute a class: java [-options] class [args...]
Execute a jar file: java [-options] -jar jarfile [args...]

10.2 Basic search algorithm

Java and Javac use the same basic search algorithm:
  • They both have the same list of places they search, to look for classes
  • They both search through this list of directories in the same order
  • As soon as they find the class they are looking for, they stop searching for that class. In the case that their search lists contain two or more files with the same name, the first file found will be the file that is used
  • The first place they look is in the directories that contain the class that come standard with J2SE
  • The second place they look is in the directories defined by classpaths
  • Classpaths should be thought of as "class search paths." They are lists of directories in which classes might be found
  • There are two places where classpaths can be declared:
    • A classpath can be declared as an operating system environment variable. The classpath declared here is used by default, whenever java or javac are invoked
    • A classpath can be declared as a command-line option for either java or javac. Classpaths declared as command-line options override the classpath declared as an environment variable, but they parsist only for the length of the invocation

10.3  Jar archive

Command
Operation
jar cf jar-file input-file(s)
create a JAR file
jar tf jar-file
view the contents of a JAR file
jar xf jar-file
extract the contents of a JAR file
jar xf jar-file archived-file(s)
extract specific files from a JAR file
java -jar app.jar
run an application packaged as a JAR file (requires the Main-class manifest header)
< applet code = AppletClassName.class
        archive="JarFileName.jar"
        width=width height=height>
</ applet>
invoke an applet packaged as a JAR file

10.4   Javadoc

Include tags in the following order:
* @author      (classes and interfaces only, required)
* @version     (classes and interfaces only, required)
* @param       (methods and constructors only)
* @return      (methods only)
* @exception   (@throws is a synonym added in Javadoc 1.2)
* @see         
* @since       
* @serial      (or @serialField or @serialData)
* @deprecated  

10.5   Annotation

Annotations provide data about a program that is not part of the program itself. They have no direct effect on the operation of the code they annotate.
Annotations have a number of uses, among them:
  • Information for the compiler — Annotations can be used by the compiler to detect errors or suppress warnings
  • Compiler-time and deployment-time processing — Software tools can process annotation information to generate code, XML files, and so forth
  • Runtime processing — Some annotations are available to be examined at runtime
There are three annotation types that are predefined by the language specification itself: @Deprecated, @Override, and @SuppressWarnings.


@Deprecated — annotation indicates that the marked element is deprecated and should no longer be used.
Example:
  1 /**
  2  * @Deprecated explanation of why it was deprecated
  3  */
  4  @Deprecated
  5  static void deprecatedMethod() { }

@Override — annotation informs the compiler that the element is meant to override an element declared in a superclass.
Example:
  1 // mark method as a superclass method that has been overridden
  2 @Override
  3 int overriddenMethod() { }

@SuppressWarnings — annotation tells the compiler to suppress specific warnings that it would otherwise generate.  Every compiler warning belongs to a category. The Java Language Specification lists two categories: "deprecation" and "unchecked." To suppress more than one category of warnings, use the following syntax:
@SuppressWarnings({"unchecked", "deprecation"})
Example:
  1 // use a deprecated method and tell compiler not to generate a warning
  2 @SuppressWarnings("deprecation")
  3 void useDeprecatedMethod() {
  4      objectOne.deprecatedMethod(); //deprecationwarning - suppressed
  5 }

Google’s History: A Visual Look at the Search Engine’s Timeline

Launch in 1998, the company founded by Sergey Brin and Larry Page, has continued to grow and always expanded more and more. Today when thinking of Google it isn’t just a search engine anymore but also one of the biggest advertising platform world wide (the biggest?), a software distributor and a mobile phone manufacturer. Google is rumoured to venture even further and recently announced Google TV, an operating system for television sets. Only yesterday the company announced that it is positioning itself better in the VOIP and telephony space as well. Nobody knows when the company will stop to acquire and expand its services.

'Techproceed' team had a look at the history and timeline of Google and all this info was compiled in an infographic.


100+ Sites to Download All Sorts of Things



These days you can find all sorts of things online, from audio books to flash files, from sound effects to CSS templates. Below we compiled a list with over 100 download sites that serve that purpose.
We will also try to keep the list updated, so if your favorite download site is not here, let us know about it with a comment.

Audio Books

Librivox: One of the most popular audio libraries on the web. The LibriVox volunteers record books that are in the public domain and release them for free.
Podiobooks:  Similar to podcast, Podiobooks are serialized audiobooks that are distributed through RSS feeds. You can receive book episodes or download directly from the site. 
Oculture (Audio & Podcast):  Offers a rich array of educational and cultural media. The site editor scours through the web to find the best cultural and educational media available.
Learn Out Loud: A one-stop destination for video and audio learning resources. You can browse through over 15,000 educational audio books MP3 downloads, podcasts, and videos. The site also contains various free resources.

BitTorrent

The Pirate Bay: The web’s largest collection of bit torrent trackers. The Pirate Bay banks on its member file sharers to cull the web’s torrent files and make these available to users.
Mininova.org : What started as an alternative to the now defunct Supernova that went offline in 2004, Mininova has become the biggest torrent search engine and directory on the web. The site provides easy-to-use directory and search for all types of torrent files.
Torrent Portal : This P2P and file sharing site works like Google by linking only to .torrent metafiles and captures the caches of those files. It does not store files nor transfer data which are content linked to by .torrent files.
Now Torrents: The site scans torrent websites on the internet to provide the best results to users. Now Torrents provides an advanced real-time search engine for bit-torrents while at the same detecting and removing fake or dead torrent sites.
Torrentz: This Sweden-based torrent meta-search engine also indexes various major torrents sites including Mininova, The Pirate Bay and Demonoid. It provides various trackers per torrent that would work when another tracker is not working.

Books and Documents

Scribd: A virtual place where you can publish, discover, discuss, and share original writings and document. With 50 million unique page views per month, Scribd is a great place to learn new things. 
Sheet Music Archive: The web’s most popular music web site.  The site contains more than 22,000 classical music pieces and more than 100,000 sheet of music. It offers hundreds of free music downloads and more for subscriptions.
Computer Books.us: The site offers high quality computer related books for free download. These computer books are all legally distributed and their authors have granted permissions for the site to distribute their works.
Docstoc: This is your ultimate resource for free legal and business documents. Docstoc does not only allow you to download documents for free but it also lets you upload and share your own documents.
Tech Books for Free Download: If you’re looking for free books on Java, Perl/Phyton or other computer programming related books, this site might be of help. It offers books covering technology subjects for free download.
Project Gutenberg: The most comprehensive repository of ebooks on the web. Project Gutenberg was built by volunteers and now houses more than 27,000 titles of ebooks in its catalog. 
Free eMagazine Download – covers a comprehensive collection of free emagazines for free download.

eBooks

KnowFree: The site offers a virtual place to exchange ebooks freely., video training, and other educational materials . Know Free features a very nice search engine which enables users to search for a particular materias fast.
Spotbit:  Providing a paperless solution to publishing and for selling e-books, Spotbit makes e-book available in a different digital format than what is available on the web lately. Spotbit offers a simple Digital Rights Management (DRM) technology for E-books format. 
Ebookshare: Provides link to either an e-books torrent files or direct download to the file itself.  E-books are categorized into broader subject and the site has a nice search engine to aid you in finding the e-book you want.
Ebookee: A free book search engine. Ebookee helps you in finding e-book titles that you are particularly looking for.  The E-books listed on the site are organized in general subject categories.
Wowio: The site lets you access legally available high-quality e-books. Wowio lets you read complete books online for free. If you want to download the PDF versions, Wowio charges a minimal fee. 
Internet Archive – With the aim of building an Internet Library, this site features texts, audio, moving images, and software as well as archived web pages in its  collections. 

Clipart

Open Clip Art Library:   The site is an ongoing project to create an archive of user contributed database of clip art that can used freely. Open Clip Art Library upholds the Creative Commons and encourages users to participate in generating contents.
WP Clipart: Offers more than 29000 public domain clip art images which were designed specifically for use with Word Processors. WP Clipart provides thousands of color graphic clips, illustrations, photographs and black and white line art in lossless, PNG format.
Clker:  The site offers royalty free clip art in SVG, ODG and PNG format which are in public domain. It lets you easily embed these images in openoffice documents.
Clipart.com: The web’s largest collection of royalty-free clipart, vinyl-ready images, photos, web graphics, fonts, illustrations, and sounds. Clipart offers paid subscription to its database containing 10 million+ professional-quality images in various formats including .EPS, .JPG, .PNG, and .WMF.

Download Hubs

Softpedia:  The site contains more than 500,000 sofware programs Windows, Unix/Linux, Mac, Mobile Phones, Games and Drivers. Some of software programs in Softpedia are freeware while some are shareware.
Download.com: Cnet’s most comprehensive library of freeware offers free download.  Download.com contains tons of Windows software ranging from security software, digital photo software, educational software and more.
Open Source Mac:  A handy reference and useful tools that encourages users to utilize free and open-source software..  Open Source Mac offers a simple list of  the best and free software for the Mac OS X.
Free Downloads Center: Hosts a collection of free software, games and other desktop goodies which you can download for free. Free Downloads Center also offers a Give Away of the Day licensed software which you can download during the day only.
Tucows: The web’s original software download site. Tucows contains more than 40,000 software titles which are freeware or shareware.
Phazeddl: Hosts download warez, games, torrents, movies, software, apps, scripts, TV shows, ebooks, templates as well as key-gen of crack softwares.

Freeware

A+Freeware:  The site offers choice applications or “A+Freeware” which become useful only when combined with a valid operating system. A+Freeware lets you get copies of software for free.
Best Freeware Download: A free wares site which allows you to register and save links on the site’s member account areas. Best Freeware Download is categorized into communication desktop and games. Gamers would definitely want to check this site from time to time to check on new freewares to be added.
Free Ware Box: The site offers categorized summary of freeware software. Freeware Box contains open source software, public domain and other types of free software, all available for free download.
Freeware Zoom:  This site offers freeware for free download. Freeware Zoom is updated daily and it contains no adware or spyware.
File Hippo:  The site has considerable number of freeware, demo and shareware programs which are of high quality. File Hippo puts a premium on quality software rather than quantity. Hence the site offers only the best software.
Windows Downloads: Download.com’s Windows-only software download site offers softwre which were tested to be 100%  free of malware.
Major Geeks: Offers only the serious software meant for the serious geeks. It hosts the most comprehensive collection of computer utilities available on the web.
Brothersoft: The site offers more than 100,000 software for free download. Brothersoft does not only offer free software download but also thoroughly evaluate all the software submitted to them.

Flash Files

Ffiles: The web’s richest repository of free Flash Files. Ffiles contains Flash files which you can download freely. It also allows you to upload your own Flash files that you want to share with other users. 
Flash Kit:  If you’re a flash developer, Flash Kit is the site for you. It’s the ultimate online resource for Macromedia Flash development.
Flash Den: This site contains everything that you need for your Adobe lash project.  You can buy preloaders, templates and other things you need to finish your project. And most of these Flash components sell for as low as $1.

Fonts

Dafont: If you’re looking for some cool fonts to use for whatever purposes, you could probably pick up one or two font style at this site. Dafont offers freely downloadable fonts. You can browse fonts by author, by style or by popularity.
1001 Free Fonts: This site has a big collection of TrueType fonts which are either freeware or shareware. 1001 Free Fonts offers free fonts for both Windows and Mac platforms.
Download Free Fonts: A simply designed online resource for thousands of free fonts. Download Free Fonts contains free fonts for Windows and Mac. You can use the site’s search box to find the font you are specifically looking for or browse through the font categories.
Show Font: The site lets you download fonts for free. Show Font contains TrueType fonts for both PC and MAC. It also provides font editor and font management tools.
FontStruct: Aside from offering freely downloadable fonts, Fonstruct also has a font editor and font management applications available online. FontStruct lets you build fonts, share it with others and download fonts made by other people as well.

Games 

Liberated Games: This is a simple listing site offering free downloads of legally available games. It’s a straight-out listing of these different games including their download links.
NDS-ROMS: This is a heaven sent site for NDS gamers. NDS-ROMs offer free downloads of publicly available ROMs.
Iwin:  The Internet’s largest selection of free game downloads. You can choose to play games in the  popular categories.
Donwload Full Version PC Games: This is a blog site containing 100 best legal, free, and full version of games. The site covers free action games, free action games and 3rd person games.
Abandonia:  If you’re up for some good old DOS-based gaming experience, Abandonia may have those games. Abandonia offers DOS games which have been abandoned for so long.
Best of Games: The site offers various old games and certainly has many of them on the site. Best of all, Best of games offers these games for free download.
Free Games – A search engine for free games that can be played online or downloaded to your machine. It also covers cheat codes.

Movies

ZML: One of the Internet’s most useful download service. ZML offers update subscriptions and lets you find out about current movies by subscribing  to ZML.
Free Documentaries: offer free Streaming Independent Documentary Films, Environment Documentary, Israel, Palestine, War, George Bush, Afghanistan, Iraq, 9/11, Globalization, Media,  and more.
Moving Image Archive: A comprehensive library of  free movies, films, and videos uploaded by the site users.  Moving images include full-length films, news broadcasts, cartoons and concerts. Not all of the videos are free to download though.

MP3

eMusic: The world’s biggest online retailer of independent music and audio books. eMusic holds more than 40,000 independent labels and almost 5,000 titles of audio books from top publishers.
Jazz on Line:  The web’s most comprehensive online resources of digitalized Jazz music. Jazz on Line hosts only songs which are in public domain.
Jimmyr: A search engine for mp3 music and other digital files. Jimmyr crawls through the various mp3 resources available on the web using Google Custom Search Engine.
Music Download: The ultimate source for legally available and freely downloadable digital music on the Internet. It’s from Cnet.com, so you are pretty sure that most of the files are safe to download.
beeMP3: A music search engine useful for finding mp3-audio files available on the web. BeeMP3 currently indexes around 800,000 mp3 files.
Download Any Stuff: A digital file search engine that provides download links to free stuff over the Internet. Download Any Stuff lets you search for MP3 files, softwares, drivers, games, movies, ebooks, even Torrents and more.
Skreemr: Another music search engine that you can use to locate audio files available on the web. Skreemr currently indexes and crawls more than 6 million mp3 files from 100,000 web sites.
iLike: A social music discover site that allows you not only to discover music playlists available on the web but also to share your own playlists to the world. iLike also links to iTunes and Amazon music stores.
eMP3 World: A free mp3 download site. eMP3 World currently holds around 85,000 mp3 download links on its database.
Jamendo/: An online community of free, legal and unlimited digital music content. Jamendo offers only those music which have been licensed under Creative Commons. The site lets you share your own music and create your own widget playlists which you can embed to your site or social networking profiles.

Online Video

Vixy:An online video converter that you can use to convert a Flash video / FLV file or YouTube videos to MPEG4 format. Vixy uses a compressed domain transcoder technology. You can enter a YouTube link to have it converted into MPEG4 online.
Keepvid: The site lets you download streaming videos from YouTube, Putfile, Metacafe and other video streaming sites. After downloading you need to convert it into another format depending on what media player you are using. Or you can use FLV’s own media player instead.
Javimoya: Another good video downloader site. Javimoya supports many video streaming sites including YouTube, Metacafe, MySpace Music, and more.
VideoDownloadx: The site allows you to download videos from YouTube and save these videos to your PC. You also need to download an FLV player to view the videos from your local hard drive or convert the file into other formats that can be read by your media player software.
Download YouTube Videos as mp4 Files: This blog post gives a detailed instruction on how to download videos directly from YouTube in mp4 format. No need to use a third-party site to scrape the video off from YouTube.
Kiss YouTube: Offers an easy and simple way of downloading and saving YouTube video directly to your computer. You can enter the URL of the video on the Kiss You Tube site, or add the word “kiss” on the URL of the YouTube video to download the file. Either way, you will still download the file from the Kiss You Tube site itself.
Download YouTube Videos: This site lets you download YouTube videos faster and easier. You just nee to enter the YouTube URL of the videos that you want to download
keepHD - lets you download HD videos off Youtube. It also lets download the mobile 3GP version for your mobile devices plus the standard MP4 and FLV format.

Photoshop and Design

Deviant Art Photoshop Brushes: A collection of artsy paintshop brushes used by Deviant Art members. You can download the paint brushes or share it to other people.
Adobe Market Place and Exchange: Adobe’s online resource containing tools, services, and innovations relating to Adobe’s various products. The site also let you discover Adobe AIR runtime applications.
Pixel Chick: Offers both free and paid Photoshop brushes that are compatible with CS2 and CS3.
Vecteezy: Serves as an index of free vector graphics that are available for download from the web. Vecteezy’s vector graphics were created by famous designers.
Busheezy: A huge collection of free Photoshop brushes and patterns. Busheezy is updated daily and also accepts submission of Photoshop brushes from online users.
Vector 4 Free: A free vector graphics site for Adobe Illustrator AI, EPS, PDF, SVG, and Corel Draw CDR. All the vector graphics  are free for personal and commercial use.
Get Brushes: A directory of brushes personally handpicked by the site owners. Get Brushes contains various brushes including over abstract and text, gothic, coffee pills and more.
Q Vectors: The site offers free high-quality vector images and graphics. Q Vector also accepts user submissions.
Archive 3D: Host more than 17,000 3D graphics model. Archive 3D models ranges from Beds,Shkaps, Chairs,Tables,Sofa, Sanitary Ware, Decoration, NVAC, Tools, and more.
Vectormix – This site has a good collection of vector graphics submitted by users and arre free to download.

Sound Effects

Soundsnap: A library of more than 100, 000 high-quality sound effect and music loops. Soundsnap offers 5 free downloads per month, after which you need to pay a Pro membership to download more files.
FindSounds: A useful sound and sound effects search engine. FindSounds offers sound directory, keyword search and sonic similarity search functions.
Partners in Rhyme: The site offers royalty free music featured in Films, TV, Video and Websites. Partners in Rhyme also offers free music loops, midi files and audio software.
Stone Washed: An online resource for free sound effects, loops, button sounds and other multimedia files. Stone Washed offers various categories including sound effects, animal sounds, buy out music and more.

Stock Photos

Stock.Xchng: One of the web’s leading stock photography site. Stock.xchng offers a full gallery of high-quality stock photos  available for free download or for sharing on blogs, social networks and other sites.
Free Digital Photos: Contains thousands of royalty free photos available for download and can be used for commercial or non-commercial purposes. Free Digial Photos does not require registration to download stock photos from their site.
Morgue File: The site provides high-resolution stock photography images for free regardless of whether the photos will be used for corporate or private use. Morgue File is the place to keep post production materials.
123RF –  The site offers a daily dose of free high-quality images aside from the paid stock images that it sells.

System utilities

Open Drivers: A free driver download service. Open Drivers is categorized by device category and driver manufacturer. It also includes step-by-step process to install and uninstall the drivers.
DLL Files: A very useful site for users who keeps on getting the missing DLL prompt from the machine. DLL Files contains a comprehensive databased of dll-files that you could possibly need.
Download 3K: A huge archive of free and free-to-try software programs and games for Windows. Download 3K is categorize into 15 main categories and the site is updated with around 300 software everyday.
Free Codecs: The ultimate resource for all types of codecs available online. Free Codecs offers video codecs, audio codecs, codec packs, codec tools and more.
Open Office: Home of the free open-source office software suite. Open Office contains word processing, spreadsheets, database, presentations, graphics, and more.

Web Design

Open Source Web Design: A collection of web designs submitted by the community members. Open Source Web Design offers free web design for download that can be used for personal blogs to a full-featured content management systems for businesses.
Free CSS Templates:The site offers standards compliant CSS templates for free. Users are free to use the templates for personal or business purposes.
Template World: Offers top quality, creative and unique web site templates created by certified web professionals.
Iconspedia: The site offers free icons download. Iconspedia are arranged in various categories including animals, food and phones.
Free Icons Web: The site contains 15000 high quality icons for free downloads. Free Icons Web contains icons for Windows XP, Vista, Macintosh, and Linux. Icons are for personal use only. Commercial users have to pay a certain amount of royalty.
1000+ Classic Icons for Free Download: Probably the best collection of free icons available online. Icons are in png, icns, ico-formats as well as .EPS vector files.
Spotbit: The site allows you to publish and sell e-books using a fast, easy and free method. Spotbit lets you create your e-books and published it on Spotbit.
Smashing Magazine’s 40 Professional Icon Sets for Free Download: A list of 40 high-quality professional icons for desktops and web design which are all free for download. The icons can be used for private and commercial purposes.