原创 求最大值max

import java.util.Scanner; class Max{ public static void main(String[] args) { int x,y,z; int max; Scanner

原创 Exam1_2

class Exam1_2{ public static void main(String args[]){ int a=Integer.valueOf(args[0]).intValue(); int b=Integer.v

原创 java構造函數

class Chongzai { public static void main(String[] args) { int i1=3,i2=5; //byte,short,char-

原创 55--尋找倍數

題目描述 Color of balloons:Green 給你三個數a,b,k,請你找出[a,b]中k的倍數. Description in English:  Give you three numbers a, b, k, ple

原创 創建java類並實例化對象

/** * AWT Sample application * @author foreverlove111 * @version 1.00 17/10/17 */ public class Zoo { publi

原创 打印99乘法表,並用continue剔除任意行

class Chengfa{ public static void main(String[] args){ int i,j; LOOP: for(i=1;i<=9;i++){ for(j=1

原创 求和數列

1.while結構class Zuoye1{ public static void main(String[] args) { int i=1; int sum=0; while(i<=100)

原创 switch語句輸出百分制的分數段

import java.util.Scanner; public class Grade { public static void main(String args[]) { Scanner sc=new Scanner(Syst

原创 靜態方法:無法在靜態上下文中引用非靜態

如上是經典的Fobonacci遞歸算法: public class Fibonacci { public static void main(String []args) { int x =

原创 錯誤: 類A是公共的, 應在名爲A.java 的文件中聲明

git同步,突然有一天 一直提示:“Error:(25, 8) 錯誤: 類 是公共的, 應在名爲.java 的文件中聲明” 原因找了好久好久.....居然是   java文件名a.java    在public...卻寫成 publi

原创 簡單計算

class Exam1_1{ public static void main(String args[]){ int var1; double var2; var1=128; var2=12.5; System.out.pr

原创 IDEA無法導入HttpSession

問題: HttpSession session 無法導包 問題在於servlet-api.jar,tomcat中自帶這個jar包,所以在Eclipse中從來沒配置過,但是沒想到idea上要手動將此jar包引入工程。 @Reque

原创 隱藏手機號中間4位

<html> <body> <script type="text/javascript"> var str="19615068006" document.write(str.substr(0,3),"****",str.subst

原创 org.hibernate.exception.GenericJDBCException: Could not open connection

org.hibernate.exception.GenericJDBCException: Could not open connection     at org.hibernate.exception.internal.Standar

原创 實驗 編譯技術綜合應用-JAVA文件的自動打點

一、   實驗目的 編譯原理在JAVA可測試性中的應用。通過對源程序進行分析,在特定位置增加特定的打印語句,方便對程序執行過程的跟蹤定位。比如:函數出入口增加打印語句。   實驗要求 讀取一個JAVA文件,進行語法解析,在函數出入口增加打