小编Cha*_*bel的帖子

缓冲读卡器与文件读取器和扫描仪类之间的区别

任何人都可以解释我的类之间的区别BufferedReader,FileReader以及Scanner?当我想阅读文本文件时使用哪一个?

java filereader bufferedreader java.util.scanner

12
推荐指数
1
解决办法
3万
查看次数

死代码java eclipse

我试图检查用户给出的单词是否已经存在于文本文件中,或者它的子字符串是否已存在.这是我的代码:

String ans = null;
Scanner scanner = null;
do
{
    System.out.print("Please enter a new word: ");
    String Nword = scan.next();
    System.out.print("And its appropriate Hint: ");
    String Nhint = scan.next();

    Word word = new Word(Nword , Nhint);
    File file = new File("C:\\Users\\Charbel\\Desktop\\Dictionary.txt");
    file.createNewFile();
    scanner = new Scanner(file);
    if (scanner != null)
    {
        String line;
        while (scanner.hasNext()) {
            line = scanner.next();
            for(int i = 0 ; i<line.length(); i++)
                if ((line.equals(Nword)) || (Nword.equals(line.substring(i))))
                {
                    System.out.println("The word already exists.");
                    break;
                }
        }
    } …
Run Code Online (Sandbox Code Playgroud)

java dead-code

1
推荐指数
1
解决办法
1810
查看次数

html链接到另一个页面的中间

同道编码员,我只想知道是否有一个HTML代码可以将我链接到另一个html/php页面的中间,而不是在同一页面上.我搜索了很多网站,但我找到的所有网站都链接到同一页面的中间位置.希望有人可以帮助我

html php

0
推荐指数
1
解决办法
4012
查看次数