As the name goes it quite obvious that, Packages are collection of set or collection of something that are of same type. They are invoked in the first line of code.
There are basically two types of packages.
Type 1: Built in type or system defined.
Type 2: User defined or customized version.
What can be done with packages in JAVA.
1.It can be used to categorize and maintain the classes that are used frequently.
2.It helps in providing ACCESS protection and removes NAMING collision.
HOW TO USE packages:
Packages can be considered as a per-structured frame layout which contains many classes that a user can invoke by calling in the initial lines of the code.There is basically two ways in which a package can be imported.
1.By using –import java.util.Arrays; — this line imports the necessary settings needed for creating arrays, while this line of code imports ONLY the settings that are required to build array.
2.By using — import java.util.*; — imports the complete package.
The optimized way of using packages are by importing only the the required class i.e., by using the 1st method, as it makes the program lightweight and fast.
Security Explorations, the Polish security startup that discovered the Java SE 7 vulnerabilities that have been the targets of recent web-based exploits, has spotted a new flaw that affects the patched version of Java released this Thursday.
The company would not disclose specific details on the nature of the new vulnerability because it does not release such information to the public – a reasonable precaution.
However, Security Explorations founder and CEO Adam Gowdiak was able to confirm that the defect does affect Java SE 7 Update 7, which Oracle released this week as a rare out-of-band patch.
“The bug is related to some of our previous bugs reported to Oracle in April 2012 (and not yet patched) in such a way so that it allows to exploit them again,” Gowdiak told El Reg in an email.
As in the case of the earlier vulnerabilities, Gowdiak says, this flaw allows an attacker to bypass the Java security sandbox completely, making it possible to install malware or execute malicious code on affected systems.
Unlike the earlier vulnerabilities, no known exploit of the new flaw has yet been found in the wild, but Gowdiak says he included proof-of-concept code with the report to demonstrate that an exploit is indeed possible.
Oracle has not acknowledged that the new vulnerability actually exists, but it has confirmed that it has received Security Explorations’ vulnerability report and is analyzing it.
Assuming Oracle does agree that the flaw exists, however, when it will be patched is anybody’s guess. The next scheduled Java Critical Patch Update (CPU) isn’t due until October 16 – and when Oracle released its last Java CPU in June, it had only patched two of the 31 flaws Security Explorations reported in April.
Oracle could release another emergency patch as it did this week, but such occasions have been rare for the database giant. It may be reluctant to do so again, given that the new flaw isn’t known to be under active attack.
That’s likely to happen soon, though. Now that the black hat community knows that a vulnerability exists, creating an exploit will only be a matter of locating it.
For the time being, given the apparent similarity of this flaw to the ones previously reported, users are advised to either disable Java in their browsers or uninstall it completely to avoid falling prey to any future exploits.