(S.equalsignorecase ("Exit")) {Break}System.out.println (S.touppercase ());s = Br.readline ();}Br.close ();}catch (IOException e) {E.printstacktrace ();}}}BA, FileInputStreamImport java.io.*;public class Testfileinputstream {public static void Main (string[] args) {FileInputStream in = null;try {in = new FileInputStream ("E:/1.txt");}catch (FileNotFoundException e) {SYSTEM.OUT.PRINTLN ("File not Found");System.exit (-1);}The following indicates that a file was foundint tag = 0;try {Long num = 0
getting started are as follows:/*Requirement: Practice a Hello World program.Ideas:1, the definition of a class, because Java programs are defined in the class, Java programs are in the form of a class, the form of a class is actually a byte-code file is finally embodied.2. Define a main function. In order for the class to run independently.3, because the demo Hello World, see the word on the console, so you need to use the output statement to complete.Steps:1, use class keyword to complete the
using the Lock () and Unlock () Methods of the Reentrantlock class
2. Communication
Use the Newcondition () method of the Reentrantlock class to get the condition object
Use condition's await () method when you need to wait, wake up with the signal () method
Different threads use different condition so that you can tell which thread to look for when waking up.
Five. Summary of synchronous and non-synchronous classes
StringBuffer and Stringbui
) Setfillcolor: (Shapecolor) C{Fillcolor=c;}-(void) Draw{NSLog (@ "Drawing a circle at (%d%d)%d) in%@",Bounds.x,bounds.y,bounds.width,bounds.height,colorname (Fillname));}@endThe Hidden object self corresponds to this in C. Self->fillcolor to access member variables.11. Call the written class and class functions:Creating a new object, using the default initialization functionBank *bankdefault = [[Bank alloc] init]; Call Method:[Bank addamount:1];[Bank print]; To dispose of objects:[Bankdefault f
parameters of the SQL statement to the database server separately, so that the database can distinguish which is the backbone of the SQL statement which is the parameters, so even if the parameters with the SQL keyword, The database server also simply uses him as a parameter value, and the keyword does not work, thereby preventing SQL injection from being a principle issue.Preparestatement Case:Package Cn.itheima.jdbc;import Java.sql.connection;import Java.sql.preparedstatement;import java.sql.
{//1. Registered driver Class.forName ("Com.mysql.jdbc.Driver");
2. Get the connection con= drivermanager.getconnection ("Jdbc:mysql://localhost:3306/day10", "root", "169500");
3. Get the Transfer object Sta=con.createstatement ();
4. Result set Rs=sta.executequery ("SELECT * from user");
5. Traverse the result set while (Rs.next ()) {String name=rs.getstring ("name");
SYSTEM.OUT.PRINTLN (name);
}}catch (Exception e) {e.getmessage ();
}finally{if (rs!=null) {try {rs.close (
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.