- HTML 페이지(index.html, aboutme.html, photo.html)
- Servlet 1개(TodayServlet)
- Tomcat 서버 위에서 동작
- index.html
- 정렬과 배치, 간격을 일정하게 유지
- 홈, 자기소개, 내사진, 몇시에요 간격은 같아야 함
🌞 Morning 66 commits ██▍░░░░░░░░░░░░░░░░░░ 11.3% | |
🌆 Daytime 238 commits ████████▌░░░░░░░░░░░░ 40.8% | |
🌃 Evening 208 commits ███████▍░░░░░░░░░░░░░ 35.7% | |
🌙 Night 71 commits ██▌░░░░░░░░░░░░░░░░░░ 12.2% |
import java.io.IOException; | |
import java.io.PrintWriter; | |
import java.util.Enumeration; | |
import javax.servlet.ServletException; | |
import javax.servlet.annotation.WebServlet; | |
import javax.servlet.http.HttpServlet; | |
import javax.servlet.http.HttpServletRequest; | |
import javax.servlet.http.HttpServletResponse; |
import java.io.IOException; | |
import javax.servlet.ServletConfig; | |
import javax.servlet.ServletException; | |
import javax.servlet.annotation.WebServlet; | |
import javax.servlet.http.HttpServlet; | |
import javax.servlet.http.HttpServletRequest; | |
import javax.servlet.http.HttpServletResponse; | |
@WebServlet("/LifecycleServlet") | |
public class LifecycleServlet extends HttpServlet { |
import java.io.IOException; | |
import java.io.PrintWriter; | |
import javax.servlet.ServletException; | |
import javax.servlet.annotation.WebServlet; | |
import javax.servlet.http.HttpServlet; | |
import javax.servlet.http.HttpServletRequest; | |
import javax.servlet.http.HttpServletResponse; | |
@WebServlet("/TenServlet") |
import java.io.IOException; | |
import java.io.PrintWriter; | |
import javax.servlet.ServletException; | |
import javax.servlet.annotation.WebServlet; | |
import javax.servlet.http.HttpServlet; | |
import javax.servlet.http.HttpServletRequest; | |
import javax.servlet.http.HttpServletResponse; | |
@WebServlet("/TenServlet") |
import java.util.Random; | |
public class MathExam{ | |
public static void main(String[] args){ | |
System.out.println("2의 10승 = " + Math.pow(2, 10)); | |
System.out.println("16의 1/2승 = : " + Math.pow(16, 0.5)); | |
System.out.println("log200 = " + Math.log10(200)); | |
} | |
} |
package Part2; | |
public class MathExam { | |
public static void main(String[] args) { | |
// Math 클래스 : 수학 계산을 위한 클래스 | |
// cos, sin, tan, abs, random.... | |
// 생성자 자체가 private로 되어 있기 때문에 new 연산자를 이용하여 객체를 생성할 수 없음 | |
// 그러나 메소드가 모두 static으로 정의되어 있기때문에 객체를 생성하지 않아도 사용 가능 | |
int value1 = Math.max(5, 30); // 두 값 중에 큰 값을 호출 |
public class StringBufferPerformanceTest{ | |
public static void main(String[] args){ | |
// (1) String의 +연산을 이용해서 10,000개의 *를 이어붙입니다. | |
//시작시간을 기록합니다.(millisecond단위) | |
long startTime1 = System.currentTimeMillis(); | |
String str=""; | |
for(int i=0;i<10000;i++){ | |
str=str+"*"; | |
} | |
//종료시간을 기록합니다.(millisecond단위) |
package Part2; | |
public class StringExam { | |
public static void main(String[] args) { | |
// String클래스 : 불변클래스, 문자열을 다룰때 사용하는 클래스 | |
String str1 = "hello world"; | |
String str2 = str1.substring(5); | |
System.out.println(str1); // str1은 substring을 사용했어도 변하지 않음 | |
System.out.println(str2); |