Searching for "What’s"

Q:

What’s the difference between Enumeration and Iterator interfaces ?

Answer

Enumeration is twice as fast as compared to an Iterator and uses very less memory. However, the Iterator is much safer compared to Enumeration, because other threads are not able to modify the collection object that is currently traversed by the iterator. Also, Iteratorsallow the caller to remove elements from the underlying collection, something which is not possible with Enumerations.

Report Error

View answer Workspace Report Error Discuss

Subject: Java

Q:

What’s the difference between htmlentities() and htmlspecialchars()?

Answer

Htmlentities() converts all applicable characters to HTML entities. While htmlspecialcharacter()converts special characters to HTML entities. This means htmlentities( ) will check for non English language characters, such as French accents, the German umlaut, etc.

Report Error

View answer Workspace Report Error Discuss

Subject: PHP

Q:

What’s the difference between htmlentities( ) and htmlspecialchars( )?

Answer htmlspecialchars only takes care of , single quote ‘, double quote " and ampersand. htmlentities translates all occurrences of character sequences that have different meaning in HTML.
Report Error

View answer Workspace Report Error Discuss

Subject: PHP

Q:

What’s the difference between include and require?

Answer It’s how they handle failures. If the file is not found by require(), it will cause a fatal error and halt the execution of the script. If the file is not found by include(), a warning will be issued, but execution will continue.
Report Error

View answer Workspace Report Error Discuss

Subject: PHP

Q:

What’s the difference between md5( ), crc32( ) and sha1( ) crypto on PHP?

Answer The major difference is the length of the hash generated. CRC32 is, evidently, 32 bits, while sha1() returns a 128 bit value, and md5() returns a 160 bit value. This is important when avoiding collisions.
Report Error

View answer Workspace Report Error Discuss

Subject: PHP

Q:

What’s the special meaning of __sleep and __wakeup?

Answer __sleep returns the array of all the variables than need to be saved, while __wakeup retrieves them.
Report Error

View answer Workspace Report Error Discuss

Subject: PHP

Q:

If the variable $a is equal to 5 and variable $b is equal to character a, what’s the value of $$b?

Answer 100, it’s a reference to existing variable.
Report Error

View answer Workspace Report Error Discuss

Subject: PHP

Q:

I am trying to assign a variable the value of 0123, but it keeps coming up with a different number, what’s the problem?

Answer PHP Interpreter treats numbers beginning with 0 as octal. Look at the similar PHP interview questions for more numeric problems.
Report Error

View answer Workspace Report Error Discuss

Subject: PHP