제목 : 예제. JavaScript1.2의 document객체 흉내내기(title속성,write()메서드)
    
    
        
            
                | 글번호: |  | 244 | 
            
                | 작성자: |  | 레드플러스 | 
            
                | 작성일: |  | 2004/10/28 오후 12:59:00 | 
            
            
                | 조회수: |  | 7784 | 
            
        
     
 
    
	
	
    
	//JavaScript1.2의 document객체 흉내내기(title속성,write()메서드)
using System;
namespace window{//네임스페이스 == 최상위 객체
    public class document{//클래스 == 객체
        //필드 선언 : 전역변수, 속성 관련, ...
        private static object _title = "Untitled Document";//필드
        //속성(프로퍼티)
        public static object title{    //title속성
            get{
                return _title;//현재 _title 필드에 저장된 값 반환
            } //읽기전용 속성을 만들때
            set{
                _title = value;//넘겨져온 값을 _title 필드에 저장
            } //쓰기전용 속성을 만들때
        }
        //메서드
        public static void write(params object [] 매개변수){ //속성
            foreach(object 출력 in 매개변수){
                Console.Write(출력);
            }
        }
    }
    public class JavaScript{
        public static void Main(){
            window.document.title = "제목에 글쓰기";
            document.write(document.title);//1
            document.write("안녕", "하세요");//2
            document.write("반갑", "습니다.", "또 만나요");//3개인자
        }
    }
}