Package

Creating a Package such as com.syngress:

1. Create a directory such as Myclasses. Edit your environment variable classpath to include the directory you just created.

                For UNIX: setenv CLASSPATH .:$HOME/cpsc120/Myclasses:/pub/java/jdk/lib/classes.zip

                For Linux based shell: export CLASSPATH=$CLASSPATH:/java/classes:/home/tchin/Myclasses

                For Linux tcsh or csh: set CLASSPATH=($CLASSPATH /java/classes /home/tchin/Myclasses)

                For Windows: set classpath=c:/jdk1.2/lib;c:/myclasses/;

2. Create the directory structure com/syngress within the Myclasses directory.

3. Copy your classes file to the syngress directory.

4. Add the package statement to the top of the file:

               package com.syngress;

5. Try compiling it. If you did everything properly, it should compile:

               C:/> javac MyClass.java

6. Try running the class from the command prompt. For example:

              C:/> java com.syngress.Myclass

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值