Skip to main content

jing zhu's Library tagged no_tag   View Popular

29 Jul 09

StringBuffer versus String - JavaWorld

  • Using a StringBuffer for concatenation can in fact produce code that is significantly faster than using a String.
  • After the concatenation is performed on the StringBuffer object, it must be converted back into a String. This is done with the call to the toString method at location 26. This method creates a new String object from the temporary StringBuffer object. The creation of this temporary StringBuffer object and its subsequent conversion back into a String object are very expensive.
  • 1 more annotations...

HashMap (Java 2 Platform SE v1.4.2)

  • The HashMap
    class is roughly equivalent to Hashtable, except that it is
    unsynchronized and permits nulls
  • If multiple
    threads access this map concurrently, and at least one of the threads
    modifies the map structurally, it must be synchronized externally.

Vector or ArrayList -- which is better? - JavaWorld

  • both the ArrayList and Vector hold onto their contents using an Array.

Interfaces (The Java™ Tutorials > Learning the Java Language > Interfaces and Inheritance)

  • There are a number of situations in software engineering when it is
    important for disparate groups of programmers to agree to a "contract"
    that spells out how their software interacts.
  • an interface is a reference type, similar to a class, that can contain only
    constants, method signatures, and nested types.
  • 2 more annotations...

Abstract Methods and Classes (The Java™ Tutorials > Learning the Java Language > Interfaces and Inheritance)

  • Abstract Classes versus Interfaces
  • If an abstract class
    contains only abstract method declarations, it should be declared as an interface instead.
  • 1 more annotations...

Using Java Reflection

  • The ability to examine and manipulate a Java class from within itself
  • The reflection classes, such as Method, are found in
    java.lang.reflect. There are three steps that must be followed to use
    these classes

Subtyping (The Java™ Tutorials > Learning the Java Language > Generics)

  • Surprisingly, the answer is "no", because Box<Integer> and Box<Double> are not subtypes of Box<Number>

Generic Methods and Constructors (The Java™ Tutorials > Learning the Java Language > Generics)

  • Type parameters can also be declared within method and constructor signatures to create
    generic methods and generic constructors.
  • A more realistic use of generic methods

Generic Types (The Java™ Tutorials > Learning the Java Language > Generics)

  • generic type declaration
  • An invocation of a generic type is generally known as a parameterized type
  • 1 more annotations...

Introduction (The Java™ Tutorials > Learning the Java Language > Generics)

  • Generics add stability to your code by making more of your bugs detectable
    at compile time.

Providing Constructors for Your Classes (The Java™ Tutorials > Learning the Java Language > Classes and Objects)

  • The compiler automatically provides a no-argument,
    default constructor for any class without constructors

Inner Class Example (The Java™ Tutorials > Learning the Java Language > Classes and Objects)

  • Inner classes can be used to implement helper classes
    like the one shown in the example above. If you plan on handling
    user-interface events, you will need to know how to use inner
    classes because the event-handling mechanism makes extensive
    use of them

What is the difference between... | CareerCup

  • 1)final
    When applied to variable(primitive): The value of the variable cannot change.
    When applied to variable(reference): The reference variable cannot point to any other object on the heap.
    When applied to method: The method cannot be overridden.
    When applied to class: The class cannot be subclasses.



    2)finally
    There is an optional finally block after the try block or after the catch block. Statements in the finally block will always be executed (except if JVM exits from the try block). finally block is used to write the clean up code.



    3)finalize
    This is the method the JVM runs before running the garbage collector.

27 Jul 09

Amazon Interview Questions | CareerCup








  • JobSeeker on October 20, 2008 | Question #62913 (Report Dup) | Edit


    | 14






    Given an array of integers where some numbers repeat 1 time, some numbers repeat 2 times and only one number repeats 3 times, how do you find the number that repeat 3 times.



    I gave the hashmap solution. He was looking for a bitwise operator solution.








  • xmagics on August 31, 2008 | Question #57937 (Report Dup) | Edit


    | 11






    Given an array of integers, partition the array into odd one side and even numbers other side.

  • 1 more annotations...
21 Jul 09

APT from Yahoo!

  • leading the next generation of digital advertising.
1 - 20 of 303 Next › Last »
Showing 20 items per page

Diigo is about better ways to research, share and collaborate on information. Learn more »

Join Diigo