Sunday 25 November 2012

PACKAGES.......CONST..

USER DEFINED PACKAGES:
   A person defined system is one which is establishing by coffee developers to easily simplify the process of the coffee developers to keep set of sessions user interface and sub offers which are widely used. Any category or user interface is widely used by many coffee developers that category or user interface must be placed in offers.

SYNTAX:
              system pack1[.pack2[.pack3....[.packn]...]];

             Here system is  keyword and key phrase which is used for developing user defined offers pack1 symbolizes higher system and ack2 to packn symbolizes sub offers.

FOR EXAMPLE:
    
                   system p1; _ statement-1
                   system p1.p2; _ statement-2

The declaration 1 and 2 are known as system statements

RULE:
           Whenever we make user defined system declaration as a aspect of coffee system we must use system declaration as a first exe declaration. And in only one coffee resource computer file atmost (zero(or)one) one system is permitted.

STEPS FOR DEVELOPING A PACKAGE:
i. Select the appropriate system name the system name be a JAVA legitimate varying name and we revealed make sure the system declaration must be first exe declaration.
ii. Select the acceptable category name or user interface name and whose modifier must be community.
iii. The modifier of Constructor of a category must be community .
iv. The modifier of the strategies of category name or user interface name must be community.
v. At any factor time we should position either a category or an user interface in a system and provides the computer file name as category name or user interface name with expansion .java

FOR EXAMPLE:
//Test.java
package tp;
public category Test
{
    community Check ()
         {
             Sysem.out.println("TEST - DEFAULT CONSTRUCTOR");
          }
      community gap display ()
           {
                Syatem.out.println("TEST - SHOW");
             }
}
//ITest.java
package tp;
public user interface ITest
{
     gap disp();
}

SYNTAX FOR COMPILING A PACKAGE:
            javac -d . filename.java

FOR EXAMPLE:
   javac -d. Check.java

Here -d is an choice or change which gives an signal to JVM saying that go to Check.java system take the system name and that system name is designed as listing instantly provides no mistake are existing in Check.java is not containing any mistake we get Check.

        category computer file and it will be duplicated instantly into existing listing which is designed lately i.e tp(package name) The above system cannot be implemented since it doesn't contain any primary technique.

No comments:

Post a Comment