java新手笔记1 Hello World!】的更多相关文章

Intent对象和Bundle对象 功能主要是在 MainActivity中定义了2个EditText,当用户输入内容,把他传入到第二个活动, 自己新创的活动中,MyActivity中 放在MainActivity.java文件上 public class MainActivity extends ActionBarActivity { EditText et1; //activity_main.xml文件拖入两个EditText EditText et2; Button button; //拖…
1.JdbcUtil package com.yfs.javase.jdbc; import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; public class JdbcUtil { private static final String driver = "sun.j…
1.Mouse package com.yfs.javase; public class Mouse { private int index = 1; private boolean isLive = false; //跳出方法 同步锁 public synchronized void jump() { while(true) { if(!isLive ) { System.out.println("跳出第 " + index + " 田鼠"); //修改田鼠状态…
1.for package com.yfs.javase; import java.awt.Color; import java.util.Calendar; import java.util.HashSet; import java.util.Set; @SuppressWarnings("all") public class ForDemo { /** * @param args */ public static void main(String[] args) { //useAr…
Person类: package com.yfs.javase; import java.util.Date; public class Person implements Comparable { private String name; private int age; private char sex; public static Date date = new Date(); @Override public int hashCode() { final int prime = 31;…
1.set/list package com.yfs.javase; import java.util.ArrayList; import java.util.Collection; import java.util.HashSet; import java.util.LinkedHashSet; import java.util.LinkedList; import java.util.List; import java.util.Set; import java.util.SortedSet…
1.读取文件 package com.yfs.javase; import java.io.FileInputStream; import java.io.FileReader; import java.io.InputStream; import java.io.Reader; public class IODemo1 { /** * 读取文件 显示 */ public static void main(String[] args) throws Exception { //readFileS…
1.目录.文件 package com.yfs.javase; import java.io.File; public class FileDemo1 { /** * File 目录 文件 */ public static void main(String[] args) throws Exception { // 创建目录对象 没有对应目录 File file = new File("C:/abc"); //File file = new File("C:/aaa/bbb/…
1.外部类监听 package com.yfs.javase; import java.awt.Button; import java.awt.FlowLayout; import java.awt.Frame; import java.awt.TextField; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; //外部类监听 public class FrameDemo1 extends Fra…
0.Calculater package com.yfs.javase; import java.awt.BorderLayout; import java.awt.Button; import java.awt.Frame; import java.awt.GridLayout; import java.awt.Menu; import java.awt.MenuBar; import java.awt.MenuItem; import java.awt.Panel; import java.…