by Dinesh Thakur Category: Packages
 
by Dinesh Thakur Category: Packages
 
by Dinesh Thakur Category: Packages
 
by Dinesh Thakur Category: Packages

The packages are used for categorization of the same type of classes and interface in a single unit. There is no core or in-built classes that belong to unnamed default package. To use any classes or interface in other class, we need to use it with their fully qualified type name. But some time, we've the need to use all or not all the classes or interface of a package then it's a tedious job to use in such a way discussed. Java supports imports statement to bring entire package, or certain classes into visibility. It provides flexibility to the programmer to save a lot of time just by importing the classes in his/her program, instead of rewriting them.

 
by Dinesh Thakur Category: Packages

Access modifiers define the scope of the class and its members (data and methods). For example, private members are accessible within the same class members (methods). Java provides many levels of security that provides the visibility of members (variables and methods) within the classes, subclasses, and packages.

 
by Dinesh Thakur Category: Packages

One of the critical aims of Java and other object-oriented programming languages is that reusable classes should be created and made available to programmers so that the same code is not written repeatedly by different people. We reused the classes within a program by extending the classes and implementing the interfaces. Moreover, most of the classes that we created so far did not interact much with the outside world as they were almost self-contained, except that some of them referred to Java classes such as String from java.lang package and Scanner from java.util.lang package. However, while designing most of the real world applications, the developers write code in the form of Java classes, which eventually needs to be brought together to work as a single application.



 


About Dinesh Thakur

Dinesh ThakurDinesh Thakur holds an B.SC (Computer Science), MCSE, MCDBA, CCNA, CCNP, A+, SCJP certifications. Dinesh authors the hugely popular blog. Where he writes how-to guides around Computer fundamental , computer software, Computer programming, and web apps. For any type of query or something that you think is missing, please feel free to Contact us.