Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

What is packages in java

Package is a mechanism to group related classes ,interfaces and enums 
in to a single module.
Package can be declared using the following statement :
Syntax : package <package-name>
Coding Convention : package name should be declared in small letters.
package statement defines the namespace.
The main use of package is
1) To resolve naming conflicts
2) For visibility control : We can define classes and interfaces that are 
not accessible outside the class
Comment

java packages example

// import <package>			-> Imports the whole package
// import <package>.<class> -> Imports a certain class
import java.util.Scanner;
Comment

PREVIOUS NEXT
Code Example
Java :: java string replace 
Java :: java 2d jagged array example 
Java :: java assert 
Java :: Java if...else Statement 
Java :: LRU Cache java 
Java :: long java 
Java :: what is the max size of array in java 
Java :: what is java 
Java :: groovy if else 
Java :: convert alphabet to number in java 
Java :: MD5 java 
Java :: what does setFocusable do in java 
Java :: how to sort a list in java 
Java :: Java List Access Elements using get() method 
Java :: how to use Add Grepper Answer (a) 
Java :: how to read space separated integers in java 
Java :: switch in java 
Java :: knapsack problem 
Java :: splash full screen android 
Java :: recursion java fibonacci 
Java :: method overriding in java 
Java :: java interview questions for freshers 
Java :: join strings in java 
Java :: java code to get all leaf nodes of a xml 
Java :: how todo a timeout test java 
Java :: Java program to swap two numbers using bitwise xor operator 
Java :: Write a Java Program to check if any number is a magic number or not. 
Java :: find the key that has the least value in map java 
Java :: close current file android studio shortct 
Java :: spigot bukkit self cancelling task timer example repeat times 
ADD CONTENT
Topic
Content
Source link
Name
3+5 =