' IOT 기반 응용 SW과정 > Review' 카테고리의 다른 글

jQuery css  (0) 2016.08.03
안드로이드 on/off 버튼?  (0) 2016.08.03
jQuery select option value  (0) 2016.07.26
jsp 마우스 액션  (0) 2016.07.07
CSS 반응형 웹 디자인  (0) 2016.06.21
$(function() {
  $("#hello").css("background","gold");
  $("input[type='button']")
    .css("border","solid 3px red")
    .css("background","pink");
});


' IOT 기반 응용 SW과정 > Review' 카테고리의 다른 글

멀티캠퍼스의 점심메뉴  (0) 2016.09.25
안드로이드 on/off 버튼?  (0) 2016.08.03
jQuery select option value  (0) 2016.07.26
jsp 마우스 액션  (0) 2016.07.07
CSS 반응형 웹 디자인  (0) 2016.06.21
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
        <ImageView
            android:id="@+id/on_btn"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:src="@drawable/on"
            android:visibility="visible" />
 
        <ImageView
            android:id="@+id/off_btn"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:src="@drawable/off"
            android:visibility="invisible" />
 
 
cs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
        on_btn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                on_btn.setVisibility(View.GONE);
                off_btn.setVisibility(View.VISIBLE);
                state.setWi(false);
            }
        });
        off_btn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                off_btn.setVisibility(View.GONE);
                on_btn.setVisibility(View.VISIBLE);
                state.setWi(true);
            }
        });
cs


' IOT 기반 응용 SW과정 > Review' 카테고리의 다른 글

멀티캠퍼스의 점심메뉴  (0) 2016.09.25
jQuery css  (0) 2016.08.03
jQuery select option value  (0) 2016.07.26
jsp 마우스 액션  (0) 2016.07.07
CSS 반응형 웹 디자인  (0) 2016.06.21

1. jQuery로 선택된 값 읽기

 

$("#selectBox option:selected").val();

$("select[name=name]").val();

 

2. jQuery로 선택된 내용 읽기

 

$("#selectBox option:selected").text();



' IOT 기반 응용 SW과정 > Review' 카테고리의 다른 글

jQuery css  (0) 2016.08.03
안드로이드 on/off 버튼?  (0) 2016.08.03
jsp 마우스 액션  (0) 2016.07.07
CSS 반응형 웹 디자인  (0) 2016.06.21
MyBatis_Spring <student>  (0) 2016.06.09

onmouseover="this.style.background='green';this.style.color='white'"

onmouseout="this.style.background='white';this.style.color='#24a828'"


<img src="기본이미지주소" onmouseover="this.src='마우스올렸을때 바뀔이미지주소'" 

onmouseout="this.src='기본이미지주소'" border="0">

' IOT 기반 응용 SW과정 > Review' 카테고리의 다른 글

안드로이드 on/off 버튼?  (0) 2016.08.03
jQuery select option value  (0) 2016.07.26
CSS 반응형 웹 디자인  (0) 2016.06.21
MyBatis_Spring <student>  (0) 2016.06.09
三周整理考试  (0) 2016.04.04
<meta name="viewport" content="width=device-width, initial-scale=1">
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Student</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
#kb-container {
        width: 940px;
        margin: 0px auto;
        padding: 20px;
        border: 1px solid #bcbcbc;
        background-color: gray;
      }
      #kb-header {
        padding: 20px;
        margin-bottom: 20px;
        border: 1px solid #bcbcbc;
        background-color: gray;
      }
      #kb-content {
        width: 580px;
        padding: 20px;
        margin-bottom: 20px;
        float: left;
        border: 1px solid #bcbcbc;
        background-color: gray;
      }
      #kb-sidebar {
        width: 260px;
        padding: 20px;
        margin-bottom: 20px;
        float: right;
        border: 1px solid #bcbcbc;
        background-color: gray;
      }
      #kb-footer {
        clear: both;
        padding: 20px;
        border: 1px solid #bcbcbc;
        background-color: gray;
      }
      @media screen and (max-width:480px) {
        #kb-container {
          width: auto;
        }
        #kb-content {
          float: none;
          width: auto;
        }
        #kb-sidebar {
          float: none;
          width: auto;
        }
      }
}
</style>
</head>
<body>
    <div id="kb-container">
      <div id="kb-header">
        <h1>Student</h1>
      </div>
        <div id="kb-sidebar">
        <center>
            <input type="button" value="학생추가" onclick="location.href='joinForm.do'"><br>
            <input type="button" value="모든학생보기" onclick="location.href='studentList.do'"><br>
            <input type="button" value="회원정보수정" onclick="location.href='studentSearchForm.do'">    
        </center>
        </div>
        <div id="kb-content">
        <h2>사진</h2>
        <img src="이미지 주소">
      </div>
      <div id="kb-footer">
        <p>Copyright : LKB</p>
      </div>
    </div>
</body>
</html>
cs


' IOT 기반 응용 SW과정 > Review' 카테고리의 다른 글

jQuery select option value  (0) 2016.07.26
jsp 마우스 액션  (0) 2016.07.07
MyBatis_Spring <student>  (0) 2016.06.09
三周整理考试  (0) 2016.04.04
套装  (0) 2016.04.04


<?xml version="1.0" encoding="UTF-8"?>

<beans xmlns="http://www.springframework.org/schema/beans"

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

xmlns:context="http://www.springframework.org/schema/context"

xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd

http://www.springframe

<context:component-scan base-package="dao"></context:component-scan>

<bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">

<property name="driverClassName" value="com.mysql.jdbc.Driver"></property>

<property name="url" value="jdbc:mysql://localhost/데이터베이스명"></property>

<property name="username" value="유저네임"></property>

<property name="password" value="비밀번호"></property>

</bean>

<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">

<property name="dataSource" ref="dataSource"></property>

<property name="typeAliasesPackage" value="model"></property>

<property name="mapperLocations" value="classpath*:dao/mapper/**/*.xml"></property>

</bean>

<bean id="studentDao" class="org.mybatis.spring.mapper.MapperFactoryBean">

<property name="mapperInterface" value="dao.IStudentDao"></property>

<property name="sqlSessionFactory" ref="sqlSessionFactory"></property>

</bean>

</beans> 


<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE mapper

PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"

"http://mybatis.org/dtd/mybatis-3-mapper.dtd">

<mapper namespace="dao.IStudentDao">

    <insert id="insertStudent" parameterType="student">

        insert into student values( #{id}, #{name}, #{grade} )

    </insert>

    <update id="updateStudent" parameterType="student">

        update student set name=#{name}, grade=#{grade} where id=#{id}

    </update>

    <delete id="deleteStudent" parameterType="int">

        delete from student where id=#{id}

    </delete>

    <select id="selectAll" resultType="student">

        select * from student

    </select>

    <select id="selectOne" resultType="student" parameterType="int">

        select * from student where id=#{id}

    </select>

</mapper> 


package dao;

import java.util.List;

import model.Student;

public interface IStudentDao {

public List<Student> selectAll();

public Student selectOne(int id);

public void insertStudent(Student stu);

public void updateStudent(Student stu);

public void deleteStudent(int id);

}



' IOT 기반 응용 SW과정 > Review' 카테고리의 다른 글

jsp 마우스 액션  (0) 2016.07.07
CSS 반응형 웹 디자인  (0) 2016.06.21
三周整理考试  (0) 2016.04.04
套装  (0) 2016.04.04
约分  (0) 2016.03.30

인스턴스 필드(instance filed)


*메소드 외부에 선언된 변수

*기본값이 설정된 상태로 만들어짐

*인스턴스마다 각각 존재함

*상태변수

*객체가 만들어질 때 만들어지고 객체가 소멸될 때까지 존재함






public class NameCatTest {

public static void main(String[] args) {

NameCat c1,c2;

c1 = new NameCat();

c2 = new NameCat();

c1.setName("왕눈이");

c2.setNmae("방울이");

System.out.println(c1.getName);

System.out.println(c2.getName);

}

}


(NameCatTest 클래스 코드가 메모리에 올라감) -> (NameCat 클래스 코드가 메모리에 올라감) -> 

(NameCat 인스턴스를 위한 메모리가 할당됨) -> (NameCat 인스턴스를 위한 메로리가 할당됨) ->(Cat 인스턴스 상태변수들에 "왕눈이"와 "방울이"가 저장됨)





public class CharTest {

public static void main(String[] args) {

char c = 'A';

int i = 'A';

// System.out.println(c);

// System.out.println(i);

char letter = (char)(1 + 'A');

int k = 1 + 'A';

System.out.println(letter);

System.out.println(k);

}

}


B, 66






Rectangle r = new Rectangle(5, 10, 20, 30);

if(x>=0)

{

 double r = Math.sqrt(x);   변수가 겹치기에 틀림

}

-----------------------------------------

if(x>=0)

{

     double r = Math.qurt(x);

}

else

{

 Rectangle r = new Rectangle(5, 10, 20, 30);

}






Scanner in = new Scanner(System.in)

boolean done = false;

while(done)

{

 System.out.print("eversdkjfakljdfs");

 String input = in.next();

if(input.equalslgnoreCase("Q))               q가 입력될 때까지 키보드 입력을 화면에 출력하는 일을 반복하는 코드

  done = ture;

else

 {

 System.out.printls(input);

 }

}





package mid_paper;


public class BankAccount {

private double balance;

private int acNumber;

private static int numberOfAccounts = 1000;

public BankAccount(double initialBalance){

balance = initialBalance;

acNumber = numberOfAccounts++;

}

public String toString(){

return "BankAccount[accoutNumber="+acNumber + ", balance="+ balance +"]";

}

public static void main(String[] args) {

BankAccount b1= new BankAccount(100.0);

BankAccount b2= new BankAccount(200.0);

BankAccount b3= new BankAccount(200.0);

System.out.println(b1);

System.out.println(b2);

System.out.println(b3);

}

}


BankAccount[accoutNumber=1000, balance=100.0]

BankAccount[accoutNumber=1001, balance=200.0]

BankAccount[accoutNumber=1002, balance=200.0]





public class Adder{

public Static int add (int a, int b)

{

return a+ b;

}

public static void main(String[] args){

System.out.println(add(1,2));

}

}






생성자란


* 모든 생성자의 이름은 클래스의 이름과 동일하다.

* 생성자는 객체를 생성하기 위한 것이다.

* 생성자가 없는 클래스는 컴파일러가 기본 생성자를 추가한다.

* 생성자는 오버로딩 할 수 없다.


오버로딩 조건


* 메서드의 이름이 같아야 한다.

* 매개변수의 개수나 타입이 달라야 한다.

* 매개변수의 이름이 달라야 한다.


오버라이딩 조건


* 조상의 메서드와 이름이 같아야 한다.

* 매개변수의 수와 타입, 리턴타입이 모두 갑아야 한다.

* 조상의 메서드보다 더 많은 수의 예외를 선언할 수 있다.


초기화..


* String 멤버변수는 null로 자동 초기화한다.

* 지역변수는 반드시 초기화해야 한다.

* 생성자보다 초기화 블럭이 먼저 수행된다.

* 인스턴스변수보다 클래스변수가 먼저 초기화도니다.


지역변수


* 지역변수가 선언도니 메서드가 종료되면 지역변수도 함께 소멸된다.

* 메서드의 매개변수로 선언도니 변수도 지역변수이다.


접근 제어자


* public은 접근제한이 전혀 없는 접근 제어자이다.

* (default)가 붙으면, 같은 패키지 내에서만 접근이 가능하다.

* protected가 붙으면, 같은 패키지 내에서 또는 다른 패키지의 자손 클래스에서 접근이 가능하다.



인터페이스


* 표준화를 가능하게 해준다.

* 서로 관계없는 클래스들에게 관계를 맺어줄 수 있다.

* 다중상속을 가능하게 해준다.



자바의 상속


* 자바에서는 클래스의 다중 상속을 지원하지 않는다.

* 자바에서는 상속의 횟 수에 제한이 없다.

* 자바에서 상속을 표현하는 키워드는 extends이다.






' IOT 기반 응용 SW과정 > Review' 카테고리의 다른 글

CSS 반응형 웹 디자인  (0) 2016.06.21
MyBatis_Spring <student>  (0) 2016.06.09
套装  (0) 2016.04.04
约分  (0) 2016.03.30
确认问题  (1) 2016.03.25

1. 패키지를 사용하는 이점은 무엇인가?

    관리가 쉽고, 찾기도 쉬움


2. 패키지 이름을 짓는 일반적인 관례는 무엇인가?

    모두 소문자, 큰 그룹부터 작은 그룹으로


3. 인터넷 도메인 이름이 hu.ac.kr이라면 권장되는 패키지 이름은?

    kr.ac.hc


4. 만약 패키지의 이름이 company.project와 같다면 소스 파일이 저장되는 디렉토리는?

     company폴더 안에 project안에 소스파일이 저장


5. 만약 Server라는 클래스를 project.server 패키지로 만들고 싶으면 어떤 문장을 Server.java에 추가하여야 하는가?

     package project.server;

' IOT 기반 응용 SW과정 > Review' 카테고리의 다른 글

MyBatis_Spring <student>  (0) 2016.06.09
三周整理考试  (0) 2016.04.04
约分  (0) 2016.03.30
确认问题  (1) 2016.03.25
排序  (0) 2016.03.23

//상태로써 분자와 분모값을 가지고 있음

//기능으로써 다른 Fraction객체와의 사칙연산 기능

//자기자신을 약분해서 기약분수로 만드는 기능


public class Fraction {


private int numerator;

private int denominator;

public Fraction(){

numerator = 0;

denominator = 1;

}

public int getNumerator() {

return numerator;

}

public void setNumerator(int numerator) {

this.numerator = numerator;

}

public int getDenominator() {

return denominator;

}

public void setDenominator(int denominator) {

this.denominator = denominator;

}

public Fraction(int numerator, int denominator) {

super();

this.numerator = numerator;

this.denominator = denominator;

}

public String toString() {

if(denominator < 0)

return -numerator + "/" + -denominator;

else

return numerator + "/" + denominator;

}


//약분 -> 분자와 분모의 최대공약수를 찾아서 두수를 각각 나눠버림

public void reduction(){

int gcd = getGCD(numerator, denominator);

numerator /= gcd;

denominator /= gcd;

}

private int getGCD(int x, int y){

while(y != 0){

int r = x % y;

x = y;

y = r;

}

return x;

}

//덧셈 -> 통분해서 분자끼리 합 

public Fraction add(Fraction f){

int newDenominator = denominator*f.getDenominator();

int newNumerator = numerator*f.getDenominator()

+ f.getDenominator()*denominator;

return new Fraction(newNumerator, newDenominator);

}

//뺄셈 -> 통분해서 분자끼리 뺌

public Fraction subtract(Fraction f){

int newDenominator = denominator*f.getDenominator();

int newNumerator = numerator*f.getDenominator()

- f.getDenominator()*denominator;

return new Fraction(newNumerator, newDenominator);

}

//곱셈 -> 분보끼리 분자끼리 곱

public Fraction mult(Fraction f){

int newDenominator = denominator*f.getDenominator();

int newNumerator = numerator*f.getNumerator();

return new Fraction(newNumerator, newDenominator);

}

//나눗셈 ->분자 = 분모*분자, 분모 = 분자*분모

public Fraction divide(Fraction f){

int newDenominator = denominator*f.getNumerator();

int newNumerator = numerator*f.getDenominator();

return new Fraction(newNumerator, newDenominator);

}

}





public class FractionTest {

public static void main(String[] args) {

Fraction f1 = new Fraction(25,30);

Fraction f2 = new Fraction(3,18);

Fraction f3 = f1.add(f2);

Fraction f4 = f1.subtract(f2);

Fraction f5 = f1.mult(f2);

Fraction f6 = f1.divide(f2);

f1.reduction();

f2.reduction();

f3.reduction();

f4.reduction();

f5.reduction();

f6.reduction();

System.out.println("f1값 : " + f1);

System.out.println("f2값 : " + f2);

System.out.println("덧셈값 : " + f3);

System.out.println("뺄셈값 : " + f4);

System.out.println("곱셈값 : " + f5);

System.out.println("나눗셈값 : " + f6);

}

}

' IOT 기반 응용 SW과정 > Review' 카테고리의 다른 글

三周整理考试  (0) 2016.04.04
套装  (0) 2016.04.04
确认问题  (1) 2016.03.25
排序  (0) 2016.03.23
反复文  (0) 2016.03.22

+ Recent posts