why we use Collection framework in Java?
Collection means group of objects
Framework means An architecture to manipulate data
i.e. Collection Framework provide a mechanism to manipulate the group of objects such as sorting, searching , managing etc.
Framework means An architecture to manipulate data
i.e. Collection Framework provide a mechanism to manipulate the group of objects such as sorting, searching , managing etc.
- We use Collections in Java because sometimes we need to deal with several objects at a time rather than a single one.
- Not only Java but other languages/platforms have their "Collections" as well.
- Collections framework gives us powerful data structures as well as algorithms to process them. Thanks to collections we can define unique objects among loads of other, sort objects in some specific order, perform look up amongst them and many-many-many other things.
- Java's collection classes provides a higher level interface than arrays.
- Arrays have a fixed size. Collections (see ArrayList) have a flexible size.
- Efficiently implementing a complicated data structures (e.g., hash tables) on top of raw arrays is a demanding task. The standard HashMap gives you that for free.
- There are different implementation you can choose from for the same set of services: ArrayList vs. LinkedList, HashMap vs. TreeMap, synchronized, etc.
- Finally, arrays allow covariance: setting an element of an array is not guaranteed to succeed due to typing errors that are detectable only at run time. Generics prevent this problem in arrays.
What is the difference between JSP and PHP?
PHP is an open-source page scripting/templating system that is very similar to JSP and ASP. It defines its own scripting language, which looks and feels a lot like Perl. JSP uses Java as its scripting language (although some implementations support JavaScript, such as Caucho). ASP uses VBScript.
PHP is very popular -- it is used on over a million web sites -- but its main advantage (IMHO) seems to be that the language, being more "scripty" and Perl-like, is less intimidating to the great unwashed mass of HTML monkeys and hackers. In the long run, JSP and Java provide a more powerful system.
Here is a list of reasons why JSP is better than PHP:
PHP is very popular -- it is used on over a million web sites -- but its main advantage (IMHO) seems to be that the language, being more "scripty" and Perl-like, is less intimidating to the great unwashed mass of HTML monkeys and hackers. In the long run, JSP and Java provide a more powerful system.
Here is a list of reasons why JSP is better than PHP:
- Anything you can do with PHP, you can do with JSP; the reverse is not true
- JSP is Object-Oriented, so leads to cleaner code that's easier to debug, maintain, and improve. (PHP also allows objects, but the object model is more primitive, and most scripted pages ignore PHP objects and just use normal variables.)
- The equivalent syntax in JSP is just as simple to learn, so you can get up and running just as quickly -- that is, there's no extra startup cost in using Java, at least not a significant one
- Java programmers (as opposed to 15-year-old hackers or HTML monkeys) appreciate the importance of a clean language with complex OO data structures and strong typing
- With JSP, if the code inside a page gets too big, or if you want to use it elsewhere, you can cut it out, make it into a Java class, and invoke it from anywhere in your application (even not from a page). With PHP, you're stuck inside the HTML box.
- JSP's concept of state management and persistence is more explicit and powerful than PHP's. With JSP, you can specify whether a variable persists for the page, the request, the session, or the application (or if it's just local to the function). The JSP engine automatically does the right thing with cookies so you have access to the variable on later requests. With PHP, you just have "global" and "not global", you don't have automatic session management, and have to do your state thing manually with cookies or hidden variables.
How to format a write protected usb flash disk
Click start
then run regedit
go to this directory HKEY_LOCAL_MACHINE\SYSTEM\Currentcontrolset\control\
if you can't find StorageDevicePolicies under control folder
then make some new one. Follow this steps:
step 1:
go to this directory HKEY_LOCAL_MACHINE\SYSTEM\Currentcontrolset\control\
again and right click control folder
step 2:
select new, then click key and rename the new key #1 folder into
StorageDevicePolicies
step 3:
right click StorageDevicePolicies folder and select new DWORD(32-bit) Value
for 32-bit Operating System and select new DWORD(64-bit) Value
for 64-bit Operating System
step 4:
rename dword newer folder into WriteProtect, then double click WriteProtect
and change the value data into 0 with hexadecimal base, Then close regedit
step 5:
open my computer and refresh it 5 times without do anything to your usb, and
properly eject your flash drive
step 6:
plug in your usb again into your computer and format it using exfat instead of fat32
Now, you can use your USB drive again....
Subscribe to:
Posts (Atom)