Java knowledge summary

File creation / writing / reading

//ファイル作成 File file = new File ("file path"); file.createNewFile();

//ファイル書き込み FileWriter fw = new FileWriter(file); fw.write ("write 1 \ r \ n"); fw.write ("write 2 \ r \ n");

//ファイル読み込み // (If I did this right after writing the above file, I got c == -1 in the first loop) int c; FileReader fw = new FIleReader(file); while( (c = != -1) { System.out.println( (char)c); }

//ファイルクローズ fw.close();

Forward in Servlet

RequestDispatcher dis = request.getRequestDispatcher("dispatch.jsp"); dis.forward(request, response);

Recommended Posts

Java knowledge summary
Java Generics Summary
Java related summary
Java basic knowledge 1
Java 8 documentation summary
Java 11 document summary
Java 12 new feature summary
[Summary] Java environment preparation
effective java 3rd summary
Java 13 new feature summary
java basic knowledge memo
Java static [Personal summary]
Thread safe summary ~ Java ~
Java Primitive Specialization Summary
Java development link summary
Personal summary about Java
Java 10 new feature summary
java regular expression summary
Java 14 new feature summary
Summary of Java support 2018
Java design pattern summary
Java reserved word summary
Java8 Stream Rough Summary
[Java11] Stream Summary -Advantages of Stream-
Progate Java (Beginner) Review & Summary
[Java] Summary of regular expressions
[Java] Summary of operators (operator)
Java8 stream, lambda expression summary
Object-oriented summary by beginners (Java)
Summary of knowledge required to pass Java SE8 Silver
Summary of Java language basics
Java tips --Spring execution Summary
[Java] Summary of for statements
Summary of Java Math class
[Java11] Stream Usage Summary -Basics-
[Java] Summary of control syntax
Summary of java error processing
[Java] Summary of design patterns
[Java] Summary of mathematical operations
Consideration on Java Persistence Framework 2017 (Summary) -1
[For beginners] Summary of java constructor
Java release date and EOL summary
Summary of [Java silver study] package
AtCoder 400 points algorithm summary (Java edition)
Java "pass by reference" problem summary
Java EE 8 (Jakarta EE 8) New feature summary
Summary of object-oriented programming using Java
[Basic knowledge of Java] Scope of variables
Java learning (0)
Studying Java ―― 3
[Java] array
[Java Silver] Summary of access modifier points
Java protected
[Java] Annotation
[Java] Module
Java array
Studying Java ―― 9
Java scratch scratch