elem.java
来自「labs to practise link list and double li」· Java 代码 · 共 56 行
JAVA
56 行
package myList;
import java.io.*;
public class Elem
{
String title;
String author;
Elem next; // and reference to next element
boolean setA;
boolean setT;
Elem () // constructor
{
title = new String();
author = new String();
next = null;
setA = false;
setT = false;
}
public static Elem makeElem(BufferedReader In)
{
Elem h;
String i = new String();
String j = new String();
try
{
i = In.readLine();
j = In.readLine();
}
catch(IOException e)
{
/* if (e instanceof FileNotFoundException)
{
System.out.println("Input file not found: " + args[0]);
}
else System.out.println("read error!");
System.exit(-1);
*/
}
h = new Elem();
h.setTitle(i);
h.setAuthor(j);
return h;
}
public void setTitle(String t){title = t;}
public void setAuthor(String a){author = a;}
public void setNext(Elem n){next=n;}
public String getTitle(){return title;}
public String getAuthor(){return author;}
public Elem getNext(){return next;}
//public String toString(){return data + " ";}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?