一些概念~

1. pass by reference or pointer:The difference is that a pointer can also point to nothing by pointing to null, where as a reference is always associated with an object. (对于c++的一些F&Q)http://www.parashift.com/c++-faq-lite/references.html

2. Differentiate JVM JRE JDK JIT: Java Virtual Machine (JVM) is an abstract computing machine. Java Runtime Environment (JRE) is an implementation of the JVM. Java Development Kit (JDK) contains JRE along with various development tools like Java libraries, Java source compilers, Java debuggers, bundling and deployment tools.

 

3. Hashtable : a hash table or hash map is a data structure that uses a hash function to map identifying values, known as keys, to their associated values. Thus, a hash table implements an associative array. The hash function is used to transform the key into the index (the hash) of anarray element (the slot or bucket) where the corresponding value is to be sought. 

List is an ordered collection and it allow nulls and duplicates in it. Set doesn't allow duplicates it may allow nulls.

In Java,

Hashtable is basically a datastructure to retain values of key-value pair.

  • It didn’t allow null for both key and value. You will get NullPointerException if you add null value.
  • It is synchronized. So it comes with its cost. Only one thread can access in one time.

HashMap Like Hashtable it also accepts key value pair.

  • It allows null for both key and value
  • It is unsynchronized. So come up with better performance

HashSet does not allow duplicate values. It provides add method rather put method. You also use its contain method to check whether the object is already available in HashSet. HashSet can be used where you want to maintain a unique list.

4.  Modern object-oriented (OO) languages provide 3 capabilities: encapsulationinheritancepolymorphism.

5Overloading refers to methods that have the same name but different signatures inside the same class. The function that better matches the arguments when a call is made wins and is called.

    Overriding is where a subclass replaces the implementation of one or more of its parent's methods.

    virtual function or virtual method is a function or method whose behaviour can be overridden within an inheriting class by a function with the same signature.

6. Struct vs Class: The only difference is that structs have all members by default public, and classes private. Because of this difference, structs are often used to hold small sets of data, whereas classes are more often used there are methods.

7. Sorting and Searching: http://introcs.cs.princeton.edu/java/42sort/

posted @ 2011-06-27 15:29  Sw_R  阅读(197)  评论(0编辑  收藏  举报