2011.08.30


今天陈老师第一次给我们第一次上课,给我们点了下我们的欠缺,字打得太慢,工具不会使用等等的一大堆问题。所以我们是很有必要提高的。在这样下去就成文盲啦。。

Eclipse的使用:

             工作空间(workspace)、工程(project)

             在eclipseJava程序的编写和运行,及java运行环境的配置。

快捷键的配置,常用快捷键:

内容提示:Alt + /         

快速修复:Ctrl + 1

导包:Ctrl + shift + O

格式化代码块:ctrl + shift + F

向前向后:Alt + 方向键

添加注释 Ctrl+Shift+/

除去注释 Ctrl+Shift+\

程序的调试和运行

F5(跳入)  F6(跳过)   F7(跳出)

这些知识能够在我们平时的作业当总提高我们的打字速度。节省我们的时间来让我们能够干更多的事情。

下面是我们的郭老师讲的一些内容:

流的分类:

• 按数据流动方向

– 输入流:只能从中读取字节数据,而不能向其写出数据

– 输出流:只能向其写入字节数据,而不能从中读取数据

• 按照流所处理的数据类型

– 字节流:用于处理字节数据。

– 字符流:用于处理Unicode字符数据

• 按照流所处理的源

– 节点流:从/向一个特定的IO设备读/写数据的流

– 处理流:对已存在的流进行连接和封装的流

过滤流

抽象的InputStreamOutputStream类允许我们对字串及数字进行读写。为达到这个目的,还需要功能更多的子类。例如:DateInputStreamDataOutputStream允许我们对所有基本的java类型进行读写。

    文件流类与抽象的InputStreamOutputStream类相似,这些类也只支持字节级的读写操作。换言之,只能从fin对象中读取字符和字节数组。byte b=fin.read(),他们没有提供专门的数值类型,所以DataInputStream没有办法从一个文件中获取数字。

解决方案:java给流职责分工,某些流(FileInputStream)负责从文件或另一些更特殊的地方读入字节数据。而另一些流

DataInputStreamPrintWriter)负责将字节“组装”成更有用的数据类型。必须综合运用这两种流,将其合并成所谓的"过滤流(FilteredStreams",方法是将一个现成的流传递给另一个流的构建器

   下面是数据流的一些例子:

import java.io.*;

public class T1 {

public static void main(String[] args) {

String[] name = {"Tom","Jack","Mary"};

double[] salary = {300, 400, 1200}; 

try{

FileOutputStream fos = new FileOutputStream("res/salary.txt");

DataOutputStream dos = new DataOutputStream(fos);

for(int i=0; i<name.length; i++){

dos.writeUTF(name[i]);

dos.writeDouble(salary[i]);

}

dos.close();

fos.close();

///////////////////////

FileInputStream fin = new FileInputStream("res/salary.txt");

DataInputStream dis = new DataInputStream(fin);

for(int i=0; i<name.length; i++){

String n = dis.readUTF();

double s = dis.readDouble();

System.out.println(n + " : " + s);

}

dis.close();

fin.close();

}catch(Exception e){

e.printStackTrace();

}

}

}

The device is running! ############## <lsw1>sys Enter system view, return user view with Ctrl+Z. [lsw1]sys S1 [S1] Nov 23 2025 14:23:42-08:00 S1 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25. 191.3.1 configurations have been changed. The current change number is 1, the ch ange loop count is 0, and the maximum number of records is 4095. [S1]int eth-trunk 1 [S1-Eth-Trunk1]int g0/0/1 [S1-GigabitEthernet0/0/1]eth-trunk 1 Info: This operation may take a few seconds. Please wait for a moment...done. [S1-GigabitEthernet0/0/1] Nov 23 2025 14:28:31-08:00 S1 %%01IFNET/4/IF_STATE(l)[54]:Interface Eth-Trunk1 h as turned into UP state. [S1-GigabitEthernet0/0/1] Nov 23 2025 14:28:33-08:00 S1 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25. 191.3.1 configurations have been changed. The current change number is 2, the ch ange loop count is 0, and the maximum number of records is 4095.int g0/0/2 [S1-GigabitEthernet0/0/2]eth-trunk 1 Info: This operation may take a few seconds. Please wait for a moment...done. [S1-GigabitEthernet0/0/2] Nov 23 2025 14:28:53-08:00 S1 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25. 191.3.1 configurations have been changed. The current change number is 3, the ch ange loop count is 0, and the maximum number of records is 4095. [S1-GigabitEthernet0/0/2]int eth-trunk 1 [S1-Eth-Trunk1]port link-type trunk [S1-Eth-Trunk1]port trunk Nov 23 2025 14:29:33-08:00 S1 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25. 191.3.1 configurations have been changed. The current change number is 4, the ch ange loop count is 0, and the maximum number of records is 4095.all vlan 10 20 [S1-Eth-Trunk1] Nov 23 2025 14:29:43-08:00 S1 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25. 191.3.1 configurations have been changed. The current change number is 5, the ch ange loop count is 0, and the maximum number of records is 4095. [S1-Eth-Trunk1]vlan batch 10 20 30 Info: This operation may take a few seconds. Please wait for a moment...done. [S1] Nov 23 2025 14:30:13-08:00 S1 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25. 191.3.1 configurations have been changed. The current change number is 6, the ch ange loop count is 0, and the maximum number of records is 4095. [S1]int g0/0/24 [S1-GigabitEthernet0/0/24]port link-type access [S1-GigabitEthernet0/0/24]port Nov 23 2025 14:30:53-08:00 S1 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25. 191.3.1 configurations have been changed. The current change number is 7, the ch ange loop count is 0, and the maximum number of records is 4095.defa vlan 30 [S1-GigabitEthernet0/0/24] Nov 23 2025 14:31:03-08:00 S1 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25. 191.3.1 configurations have been changed. The current change number is 8, the ch ange loop count is 0, and the maximum number of records is 4095. [S1-GigabitEthernet0/0/24]q [S1]int vlan10 [S1-Vlanif10] Nov 23 2025 14:31:38-08:00 S1 %%01IFNET/4/IF_STATE(l)[55]:Interface Vlanif10 has turned into UP state. [S1-Vlanif10]ip add 10.1.10.254 24 [S1-Vlanif10] Nov 23 2025 14:31:51-08:00 S1 %%01IFNET/4/LINK_STATE(l)[56]:The line protocol IP on the interface Vlanif10 has entered the UP state. [S1-Vlanif10] Nov 23 2025 14:31:53-08:00 S1 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25. 191.3.1 configurations have been changed. The current change number is 9, the ch ange loop count is 0, and the maximum number of records is 4095. [S1-Vlanif10]int vlan20 [S1-Vlanif20] Nov 23 2025 14:32:41-08:00 S1 %%01IFNET/4/IF_STATE(l)[57]:Interface Vlanif20 has turned into UP state. [S1-Vlanif20]ip add 10.1.20.254 24 [S1-Vlanif20] Nov 23 2025 14:32:53-08:00 S1 %%01IFNET/4/LINK_STATE(l)[58]:The line protocol IP on the interface Vlanif20 has entered the UP state. [S1-Vlanif20]int vla Nov 23 2025 14:33:03-08:00 S1 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25. 191.3.1 configurations have been changed. The current change number is 10, the c hange loop count is 0, and the maximum number of records is 4095.n30 [S1-Vlanif30] Nov 23 2025 14:33:05-08:00 S1 %%01IFNET/4/IF_STATE(l)[59]:Interface Vlanif30 has turned into UP state. [S1-Vlanif30]ip add 10.1.30.254 24 [S1-Vlanif30] Nov 23 2025 14:33:18-08:00 S1 %%01IFNET/4/LINK_STATE(l)[60]:The line protocol IP on the interface Vlanif30 has entered the UP state. [S1-Vlanif30] Nov 23 2025 14:33:23-08:00 S1 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25. 191.3.1 configurations have been changed. The current change number is 11, the c hange loop count is 0, and the maximum number of records is 4095. [S1-Vlanif30]q [S1]dhcp enable Info: The operation may take a few seconds. Please wait for a moment.done. [S1] Nov 23 2025 14:35:23-08:00 S1 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25. 191.3.1 configurations have been changed. The current change number is 12, the c hange loop count is 0, and the maximum number of records is 4095. [S1]ip pool vlan10 Info:It's successful to create an IP address pool. [S1-ip-pool-vlan10] Nov 23 2025 14:35:43-08:00 S1 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25. 191.3.1 configurations have been changed. The current change number is 13, the c hange loop count is 0, and the maximum number of records is 4095. [S1-ip-pool-vlan10]net 10.1.10.0 mask 255.255.255.0 [S1-ip-pool-vlan10] Nov 23 2025 14:36:13-08:00 S1 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25. 191.3.1 configurations have been changed. The current change number is 14, the c hange loop count is 0, and the maximum number of records is 4095. [S1-ip-pool-vlan10]gat [S1-ip-pool-vlan10]gateway-list 10.1.10.254 [S1-ip-pool-vlan10]lease da Nov 23 2025 14:36:33-08:00 S1 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25. 191.3.1 configurations have been changed. The current change number is 15, the c hange loop count is 0, and the maximum number of records is 4095.y 2 [S1-ip-pool-vlan10]dn Nov 23 2025 14:36:43-08:00 S1 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25. 191.3.1 configurations have been changed. The current change number is 16, the c hange loop count is 0, and the maximum number of records is 4095.s-l [S1-ip-pool-vlan10]dns-list 8.8.8.8 [S1-ip-pool-vlan10]q [S1]in Nov 23 2025 14:37:03-08:00 S1 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25. 191.3.1 configurations have been changed. The current change number is 17, the c hange loop count is 0, and the maximum number of records is 4095.t vlanif10 [S1-Vlanif10]dhcp se [S1-Vlanif10]dhcp select g [S1-Vlanif10]dhcp select global [S1-Vlanif10] Nov 23 2025 14:37:33-08:00 S1 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25. 191.3.1 configurations have been changed. The current change number is 18, the c hange loop count is 0, and the maximum number of records is 4095. [S1-Vlanif10]undo dhcp select global [S1-Vlanif10] Nov 23 2025 14:41:53-08:00 S1 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25. 191.3.1 configurations have been changed. The current change number is 19, the c hange loop count is 0, and the maximum number of records is 4095.dhcp se [S1-Vlanif10]dhcp select re [S1-Vlanif10]dhcp select relay [S1-Vlanif10]dhcp Nov 23 2025 14:42:13-08:00 S1 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25. 191.3.1 configurations have been changed. The current change number is 20, the c hange loop count is 0, and the maximum number of records is 4095. [S1-Vlanif10]dhcp r [S1-Vlanif10]dhcp relay s [S1-Vlanif10]dhcp relay server-ip 10.1.30.253 [S1-Vlanif10] Nov 23 2025 14:42:53-08:00 S1 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25. 191.3.1 configurations have been changed. The current change number is 21, the c hange loop count is 0, and the maximum number of records is 4095.
11-24
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值