jsp製作簡易加法計算器

定義三個變量a,b,sum分別爲第一個數,第二個數以及最終得數,判斷表單控件的值是否不爲空request.getParameter(「first」)!= null && request.getParameter(「second」)!= null 因爲 request.getParameter()返回的字符串,而我們需要數值類型進行加法運算,所以轉換爲Integer類型再用先前定義的a,b分別接收,
相關文章
相關標籤/搜索