<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-905901812770512183</id><updated>2024-09-11T09:49:11.896-07:00</updated><category term="android"/><category term="java"/><category term="jeus"/><category term="session"/><category term="tomcat"/><category term="Facebook API"/><category term="Facebook API 공유"/><category term="Facebook API 공유하기"/><category term="band api"/><category term="band 공유하기"/><category term="bitcoin"/><category term="block"/><category term="blockchain"/><category term="chain"/><category term="downcon"/><category term="ja"/><category term="jeus7"/><category term="jeus7 재기동"/><category term="jeus재기동"/><category term="jsessionname"/><category term="kakao api"/><category term="kakaostory api"/><category term="sessionCookieName"/><category term="sessionname"/><category term="startcon"/><category term="totalcommander"/><category term="was"/><category term="wcfg"/><category term="webtob"/><category term="wsadmin"/><category term="wsboot"/><category term="wsdown"/><category term="가상화폐"/><category term="네이버 밴드 api"/><category term="네이버 밴드 api 공유하기"/><category term="로그인"/><category term="밴드 api"/><category term="블록"/><category term="블록체인"/><category term="비트코인"/><category term="웹투비"/><category term="중복로그인"/><category term="중복로그인방지"/><category term="체인"/><category term="카카오스토리 api"/><category term="카카오스토리 api 공유"/><category term="카카오스토리 api 공유하기"/><category term="카카오톡 api"/><category term="카카오톡 api 공유하기"/><category term="카카오톡 공유"/><category term="토탈커맨더"/><category term="페이스북 api"/><category term="페이스북 공유"/><title type='text'>bridroid</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://bridroid.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/905901812770512183/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://bridroid.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/905901812770512183/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>brith1225</name><uri>http://www.blogger.com/profile/15293023387175369557</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>33</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-905901812770512183.post-4020273647346333616</id><published>2018-02-06T23:44:00.000-08:00</published><updated>2018-02-06T23:44:11.586-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="bitcoin"/><category scheme="http://www.blogger.com/atom/ns#" term="block"/><category scheme="http://www.blogger.com/atom/ns#" term="blockchain"/><category scheme="http://www.blogger.com/atom/ns#" term="chain"/><category scheme="http://www.blogger.com/atom/ns#" term="가상화폐"/><category scheme="http://www.blogger.com/atom/ns#" term="블록"/><category scheme="http://www.blogger.com/atom/ns#" term="블록체인"/><category scheme="http://www.blogger.com/atom/ns#" term="비트코인"/><category scheme="http://www.blogger.com/atom/ns#" term="체인"/><title type='text'>비트코인</title><content type='html'>&lt;h3 id=&quot;비트코인의-실체&quot; style=&quot;font-family: &amp;quot;Noto Sans KR&amp;quot;, &amp;quot;Apple SD Gothic Neo&amp;quot;, &amp;quot;Nanum Gothic&amp;quot;, 나눔고딕, &amp;quot;Malgun Gothic&amp;quot;; margin: 45px 0px 25px;&quot;&gt;
비트코인의 실체&lt;/h3&gt;
&lt;div style=&quot;font-family: &amp;quot;Noto Sans KR&amp;quot;, &amp;quot;Apple SD Gothic Neo&amp;quot;, &amp;quot;Nanum Gothic&amp;quot;, 나눔고딕, &amp;quot;Malgun Gothic&amp;quot;; line-height: 1.9em; word-wrap: break-word;&quot;&gt;
비트코인은 2009년 ‘사토시 나카모토’라고 알려진 개인 또는 다수의 개발자들을 통해 탄생했습니다. 사토시는 일본인이 아니고 가명입니다. 현재, 호주의 암호학 전문가인 크레이그 라이트나 게임이론의 창시자인 경제학자 존 내쉬 등이 사토시라고 추정되고 있지만 각국의 규제와 법률 때문인지 확실하게 밝혀진 사람은 아직 없습니다.&lt;br /&gt;우리가 보통 부른 비트코인이라는 용어의 실체적 개념은 존재하지 않습니다. 누가 얼마를 소유하고 있다는 잔액 개념의 원장 데이터도 없습니다. 비트코인 생태계의 모든 속성과 특징은 사토시가 2009년 발표한&amp;nbsp;&lt;a href=&quot;http://bitcoin.org/bitcoin.pdf&quot; style=&quot;border-bottom: 1px solid rgb(85, 85, 85); text-decoration-line: none;&quot;&gt;논문&lt;/a&gt;을 토대로 구현한&amp;nbsp;&lt;a href=&quot;http://bitcoing.org/ko/download&quot; style=&quot;border-bottom: 1px solid rgb(85, 85, 85); text-decoration-line: none;&quot;&gt;비트코인 코어 Bitcoin Core 프로그램&lt;/a&gt;안에 프로그램(코딩)되어 있으며, 이 시스템 하에서 발생하는 거래 내역의 모음이 블록체인이라고 불리는 공개장부에 저장될 뿐입니다. 비트코인 시스템 또는 비트코인 네트워크라고 부르는 것의 실체는 바로 이 네트워크를 의미합니다. 비트코인 코어 프로그램은 Bitcoin.org를 통해 누구나 PC로 다운받을 수 있으며 github라는 온라인&amp;nbsp;&lt;a href=&quot;https://github.com/bitcoin/bitcoin&quot; style=&quot;border-bottom: 1px solid rgb(85, 85, 85); text-decoration-line: none;&quot;&gt;오픈소스 저장소&lt;/a&gt;에 모든 소스도 올려져 있어서 지금은 전 세계 개발자들의 공헌에 의해 발전하고 있습니다. 지금까지 나온 1,000개가 넘는 대안화폐(altcoin)나 이더리움(Ethereum) 같은 블록체인 플랫품 역시 최초의 비트코인코어 프로그램의 소스를 모방해서 발전했습니다. 거래내역의 모음인 DB역할을 하는 공개장부 역시 비트코인코어 프로그램을 다운 받은 사람들은 누구나 내려받을 수 있습니다. 비트코인이 출시된 이후 지금까지 전 세계 모든 거래의 공개장부는 약 수십 기가바이트 용량의 파일로 구성되어 있습니다. 다운 받으려면 며칠은 걸리겠지만 전 세계 모든 거래의 장부를 가질수 있게 되는것이죠.&lt;br /&gt;이제 비트코인의 거래가 어떠헤 이뤄지는지 사례를 통해 살펴보겠습니다.&lt;/div&gt;
&lt;h3 id=&quot;비트코인-거래-예시&quot; style=&quot;font-family: &amp;quot;Noto Sans KR&amp;quot;, &amp;quot;Apple SD Gothic Neo&amp;quot;, &amp;quot;Nanum Gothic&amp;quot;, 나눔고딕, &amp;quot;Malgun Gothic&amp;quot;; margin: 45px 0px 25px;&quot;&gt;
비트코인 거래 예시&lt;/h3&gt;
&lt;ul style=&quot;font-family: &amp;quot;Noto Sans KR&amp;quot;, &amp;quot;Apple SD Gothic Neo&amp;quot;, &amp;quot;Nanum Gothic&amp;quot;, 나눔고딕, &amp;quot;Malgun Gothic&amp;quot;; margin: 40px 0px; padding-left: 50px;&quot;&gt;
&lt;li style=&quot;word-wrap: break-word;&quot;&gt;앨리스 : 난생 처음 비트코인을 사고 싶어 하는 여자&lt;/li&gt;
&lt;li style=&quot;word-wrap: break-word;&quot;&gt;조 : 앨리스에게 비트코인을 팔아줄 남자&lt;/li&gt;
&lt;/ul&gt;
&lt;div style=&quot;font-family: &amp;quot;Noto Sans KR&amp;quot;, &amp;quot;Apple SD Gothic Neo&amp;quot;, &amp;quot;Nanum Gothic&amp;quot;, 나눔고딕, &amp;quot;Malgun Gothic&amp;quot;; line-height: 1.9em; word-wrap: break-word;&quot;&gt;
앨리스는 스마트폰으로 비트코인 지갑 어플리케이션을 다운받았습니다. 지갑 어플리케이션은 임의로 개인키와 그에 대응하는 비트코인 주소를 발행합니다. 계좌번호나 이메일주소가 부여된다고 생각하면 됩니다. 이 주소는 개인키에 대응되는 일련의 숫자에 불과하며 아직 비트코인 네트워크상에 공개되거나 등록되지 않습니다. 비트코인 주소가 거래와 연관되어 네트워크상에서 주소가 공개되면 앨리스는 공개장부를 통해 해당 주소의 잔액을 확인할 수 있다.&lt;/div&gt;
&lt;blockquote style=&quot;background: rgb(238, 238, 238); border-left: 5px solid rgb(204, 204, 204); font-family: &amp;quot;Noto Sans KR&amp;quot;, &amp;quot;Apple SD Gothic Neo&amp;quot;, &amp;quot;Nanum Gothic&amp;quot;, 나눔고딕, &amp;quot;Malgun Gothic&amp;quot;; margin: 40px 0px; padding: 5px 30px;&quot;&gt;
&lt;div style=&quot;font-size: 16px; line-height: 1.9em; word-wrap: break-word;&quot;&gt;
여기서&amp;nbsp;&lt;strong&gt;비트코인 네트워크&lt;/strong&gt;, 또는&amp;nbsp;&lt;strong&gt;네트워크 노드(node)&lt;/strong&gt;&amp;nbsp;란, 비트코인 시스템의 기능과 요소들을 포함하고 있는 클라이언트를 말합니다. 이를 테면, bitcoin.org의 기본 클라이언트이자 사토시가 만든&amp;nbsp;&lt;a href=&quot;https://bitcoin.org/ko/download&quot; style=&quot;border-bottom: 1px solid rgb(85, 85, 85); text-decoration-line: none;&quot;&gt;비트코인코어 클라이언트&lt;/a&gt;가 설치된 PC를 의미합니다. 이 클라이언트들은 지갑, 거래장부 복사본, 검증엔진, P2P네트워크 전송 기능 등을 가지고 있으며, 좀 더 Lite한 기능들로만 구성된 클라이언트도 많이 개발되어 있습니다. 이 글을 쓰는 저 역시 이 세계에서 하나의 노드가 될 수 있습니다.&lt;/div&gt;
&lt;/blockquote&gt;
&lt;div style=&quot;font-family: &amp;quot;Noto Sans KR&amp;quot;, &amp;quot;Apple SD Gothic Neo&amp;quot;, &amp;quot;Nanum Gothic&amp;quot;, 나눔고딕, &amp;quot;Malgun Gothic&amp;quot;; line-height: 1.9em; word-wrap: break-word;&quot;&gt;
이제 앨리스는 비트코인을 얻기 위해 현금 10달러와 비트코인 주소를(QR코드) 조에게 주었고 조는 자신의 모바일 지갑을 열어 QR코드를 스캔하고 시세에 해당하는 0.1비트코인을 주었습니다. 거래가 성사되면서 조는 개인키로 해당 거래에 대해 서명합니다. 마치 우리가 인터넷뱅킹으로 이체할 때 공인인증서로 전자서명을 하듯이 말입니다. 이 과정이 끝나면 조의 비트코인 주소 중 한 곳에서 앨리스의 새 비트코인 주소로 송금이 허가되었다고 비트코인 네트워크에 알립니다. 네트워크에 연결된 모든 노드들은 거래내역을 받고 처음으로 앨리스의 주소를 보게 됩니다.&lt;br /&gt;이 거래는 전송은 되었지만 아직 비트코인 공개장부(=거래장부=블록체인)에는 포함되지 않았습니다. 거래가 공개장부에 포함되려면 채굴자들이 채굴을 해야 하는데요(이 부분은 뒤에 가서 설명합니다.) 하나의 블록은 여러 개의 거래를 담을 수 있는데, 새로운 블록이 약 10분 주기로 형성되면 그 블록 내에 있는 거래내역들은 네트워크상에서 “승인”되며 그 후 소비가 가능합니다. 정리하자면,&amp;nbsp;&lt;strong&gt;거래는 발생하자마자 모두가 “볼” 수 있지만 새롭게 채굴된 블록에 포함되는 경우에만 모두가 “신뢰”하게 됩니다.&lt;/strong&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Noto Sans KR&amp;quot;, &amp;quot;Apple SD Gothic Neo&amp;quot;, &amp;quot;Nanum Gothic&amp;quot;, 나눔고딕, &amp;quot;Malgun Gothic&amp;quot;; line-height: 1.9em; word-wrap: break-word;&quot;&gt;
참고로 비트코인의 무서운 점은 화폐를 데이터 구조로 전환했기 때문에, 어떤 형태로든 전송이 가능합니다. 웹, 와이파이, 블루투스는 물론이거니와 라디오, 위성중계, 이모티콘, SMS등 해당 거래를 전파하게될 노드에 도달할 수만 있다면 어떤 네트워크를 사용해도 무방합니다. 극단적으로는 거래 자체는 오프라인상태에서도 가능하며 거래가 기록될 때만 네트워크로 전송하면 됩니다.미국에서 수표를 먼저 발행하고 나중에 봉투에 넣어 은행으로 우편 발송하듯이 말이죠. 스타벅스에서 신용카드 결제를 할 때, 3만원 이하는 무서명 거래를 하듯이 비트코인 시장에서도 소액이체나 결제는 비트코인 네트워크의 별도 승인이나 신뢰 없이도 인정할 수 있게 되어 있습니다.&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Noto Sans KR&amp;quot;, &amp;quot;Apple SD Gothic Neo&amp;quot;, &amp;quot;Nanum Gothic&amp;quot;, 나눔고딕, &amp;quot;Malgun Gothic&amp;quot;; line-height: 1.9em; word-wrap: break-word;&quot;&gt;
앨리스는 이제 비트코인으로 재화를 구매하고자 합니다. 어려워서 머리가 아프니 커피를 사서 마시겠습니다. 비트코인을 받아주는 커피숍에서 0.015 비트코인(BTC)짜리 커피를 주문하니 밥(Bob)이라는 사람이 관리하는 POS시스템이 payment request가 들어있는 QR코드를 보여줍니다. 여기에는 송금할 비트코인의 목적지 주소, 지불금액 등 지불과 관련된 기본내용이 담겨있습니다. 일종의 청구서 같은 겁니다. 앨리스는 지갑 어플리케이션을 열어 QR코드를 스캔후 전송 버튼을 눌러 지불을 승인합니다. 즉, 비트코인을 소비합니다. 이처럼 소비란 이전 거래에서 송금되었던 돈이 비트코인 주소에 의해 확인된 새로운 소유주에게로 전송되는 거래에 서명을 함으로써 이루어지는 작업을 말합니다.&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Noto Sans KR&amp;quot;, &amp;quot;Apple SD Gothic Neo&amp;quot;, &amp;quot;Nanum Gothic&amp;quot;, 나눔고딕, &amp;quot;Malgun Gothic&amp;quot;; line-height: 1.9em; word-wrap: break-word;&quot;&gt;
&lt;img alt=&quot;블록체인 거래원리&quot; src=&quot;http://www.leejungmin.org/images/2017-05-30/msbt_0204.png&quot; style=&quot;max-width: 100%;&quot; title=&quot;블록체인 거래원리&quot; /&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Noto Sans KR&amp;quot;, &amp;quot;Apple SD Gothic Neo&amp;quot;, &amp;quot;Nanum Gothic&amp;quot;, 나눔고딕, &amp;quot;Malgun Gothic&amp;quot;; line-height: 1.9em; word-wrap: break-word;&quot;&gt;
다시 정리하면,&amp;nbsp;&lt;strong&gt;비트코인의 거래는 비트코인을 많이 보유한 소유주가 그 일부를 다른 사람에게 전송하는 것이고, 각 거래가 체인을 형성하게 됩니다. 이때 가장 최근 거래에서 생성된 입력값은 그 이전 거래에서 발생한 출력값과 대응합니다.&lt;/strong&gt;&amp;nbsp;위 그림의 두번째 거래와 같이 거래를 한 뒤, 잔액이 발생하는 경우도 마찬가지입니다. 그림에서는 출력값이 밥에게 지불된 금액만 나왔지만, 앨리스의 남은 잔액이 또 다른 거래의 입력값이 될 수 있습니다. 앨리스는 돌려받은 잔액 결과값을 이용해 다른 거래에서 해당 금액을 소비할 수 있는 것입니다. 한편, 입력의 합과 출력의 합은 반드시 서로 동일하지는 않은데, 그 이유는 거래 속에 포함된 “거래 수수료”때문입니다. 나중에 다시 설명하겠지만 이 거래 수수료는 해당 거래를 블록에 포함시키고 공개장부(블록체인)에 올리는 것에 대해 채굴자가 수거하는 수고비, 수수료 개념입니다.&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Noto Sans KR&amp;quot;, &amp;quot;Apple SD Gothic Neo&amp;quot;, &amp;quot;Nanum Gothic&amp;quot;, 나눔고딕, &amp;quot;Malgun Gothic&amp;quot;; line-height: 1.9em; word-wrap: break-word;&quot;&gt;
지금까지 거래가 일어날 때 발생하는 현상을 살펴봤는데, 그럼 이 거래내역이 어떻게 블록의 부분이 되며, 공개장부에 추가되는지를 살펴보겠습니다.&lt;/div&gt;
&lt;h3 id=&quot;검증-채굴과-합의&quot; style=&quot;font-family: &amp;quot;Noto Sans KR&amp;quot;, &amp;quot;Apple SD Gothic Neo&amp;quot;, &amp;quot;Nanum Gothic&amp;quot;, 나눔고딕, &amp;quot;Malgun Gothic&amp;quot;; margin: 45px 0px 25px;&quot;&gt;
검증, 채굴과 합의&lt;/h3&gt;
&lt;div style=&quot;font-family: &amp;quot;Noto Sans KR&amp;quot;, &amp;quot;Apple SD Gothic Neo&amp;quot;, &amp;quot;Nanum Gothic&amp;quot;, 나눔고딕, &amp;quot;Malgun Gothic&amp;quot;; line-height: 1.9em; word-wrap: break-word;&quot;&gt;
이 거래는 이제 전세계 공개장부의 일부가 되기 위해 비트코인 네트워크로 전송되어야 합니다. 앨리스의 지갑 어플리케이션이 인터넷만 연결되어 있다면 여러 비트코인 고객들에게 새로운 거래를 전송할 수 있습니다. 비트코인 네트워크의 노드들은 자신이 이전에 가지고 있지 않은 거래를 전송받게 되면, 즉시 연결된 다른 노드로 해당 거래를 전달합니다. (이 부분은 우리가 흔히 사용하는 토렌트, P2P 방식과 비슷하다고 보면 됩니다.) 이런 과정은 불과 몇 초만에 비트코인 네트워크 내에 있는 노드 대부분에게 도달합니다&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Noto Sans KR&amp;quot;, &amp;quot;Apple SD Gothic Neo&amp;quot;, &amp;quot;Nanum Gothic&amp;quot;, 나눔고딕, &amp;quot;Malgun Gothic&amp;quot;; line-height: 1.9em; word-wrap: break-word;&quot;&gt;
이제 거래가 비트코인 네트워크에 전파되었습니다. 하지만 이 거래가 검증되고, 채굴(mining)을 거쳐, 블록에 포함되는 과정이 남아있습니다.&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Noto Sans KR&amp;quot;, &amp;quot;Apple SD Gothic Neo&amp;quot;, &amp;quot;Nanum Gothic&amp;quot;, 나눔고딕, &amp;quot;Malgun Gothic&amp;quot;; line-height: 1.9em; word-wrap: break-word;&quot;&gt;
검증하다니, 뭘 어떻게 검증하는걸까요? 답을 얻기 위해 이런 질문을 하나 해보겠습니다.&lt;br /&gt;&lt;strong&gt;중앙신뢰기관(이를테면 은행)이 없는 상태에서, 공개장부안에 있는 내용, 즉 결국 누가 무엇을 얼마나 소유하고 있는지에 대한 단 하나의 보편적 “진실”에 어떻게 전 세계 모든 사용자가 동의할 수 있을까요?&lt;/strong&gt;&amp;nbsp;답은 간단합니다. 모두가 같은 장부를 가지고 있기 때문입니다. 그럼 어떻게 모두가 동일한 장부를 가지게 된걸까요? 조작을 해서 나만 몇 억을 더 가지고 있는 거래내역을 만들어 모두에게 전달할 수는 없을까요? 예, 불가능합니다. 바로 사토시의 중요한 발명품인&amp;nbsp;&lt;strong&gt;합의도출(emergent consensus) 프로세스&lt;/strong&gt;&amp;nbsp;때문입니다. 이 합의는 독립적인 비트코인 네트워크의 노드들이 모두 동일한 규칙을 따르면서 만든 비동기적이고, 상호작용적인 결과물입니다.&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Noto Sans KR&amp;quot;, &amp;quot;Apple SD Gothic Neo&amp;quot;, &amp;quot;Nanum Gothic&amp;quot;, 나눔고딕, &amp;quot;Malgun Gothic&amp;quot;; line-height: 1.9em; word-wrap: break-word;&quot;&gt;
Computer Science 분야에서는 분산 컴퓨팅에서 발생할 수 있는 신뢰와 합의의 문제를 함축하는 비잔티움 장군의 딜레마라는 문제가 있습니다. 비잔틴 군대의 여러 사단이 적군의 도시 바끝에 진을 치고 있는데, 각 사단이 오로지 전령을 통해서만 서로 연락할 수 있다고 할 때, 배신자들을 배제한 상태로 언제 어떻게 동시적인 공격을 할지에 대한 고민입니다. 다수의 노드(PC)가 참여하는 분산네트워크에서 합의와 의사결정은 아주 핵심적인 문제인데, 사토시가 이 부분에 대해 중요한 솔루션을 발견한 것이죠. 결론부터 얘기하면 배신자는 다수의 충직한 장군들에 의해 폐기된다는 원칙입니다. 그리고&amp;nbsp;&lt;strong&gt;이 충직성을 작업증명(Proof of Work)라는 방법으로 입증&lt;/strong&gt;&amp;nbsp;하는 것입니다. 이 발견은 단순히 통화 뿐 아니라 자산, 선거, 계약 등 공정성을 입증해야 하는 분산 네트워크 환경에서 아래 중요한 해결책이 될 수 있다는데서 큰 의미가 있습니다.&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Noto Sans KR&amp;quot;, &amp;quot;Apple SD Gothic Neo&amp;quot;, &amp;quot;Nanum Gothic&amp;quot;, 나눔고딕, &amp;quot;Malgun Gothic&amp;quot;; line-height: 1.9em; word-wrap: break-word;&quot;&gt;
다시 사토시의 합의로 돌아와서 살펴보면 이 합의 프로세스는 크게 네 가지가 있습니다.&lt;/div&gt;
&lt;ol style=&quot;font-family: &amp;quot;Noto Sans KR&amp;quot;, &amp;quot;Apple SD Gothic Neo&amp;quot;, &amp;quot;Nanum Gothic&amp;quot;, 나눔고딕, &amp;quot;Malgun Gothic&amp;quot;; margin: 40px 0px; padding-left: 50px;&quot;&gt;
&lt;li style=&quot;word-wrap: break-word;&quot;&gt;모든 노드가 각 거래마다&amp;nbsp;&lt;strong&gt;독립된 검증&lt;/strong&gt;&amp;nbsp;실시&lt;/li&gt;
&lt;li style=&quot;word-wrap: break-word;&quot;&gt;어떤 채굴자가 작업증명에 성공하면 다른 채굴자들이 검증하여 검증된 거래들을 새로운 블록에&amp;nbsp;&lt;strong&gt;독립적으로&lt;/strong&gt;&amp;nbsp;추가&lt;/li&gt;
&lt;li style=&quot;word-wrap: break-word;&quot;&gt;모든 노드들이 새 블록을 독립적으로 검증한 다음 체인에 블록을 연결&lt;/li&gt;
&lt;li style=&quot;word-wrap: break-word;&quot;&gt;모든 노드가 작업증명을 통해 나온 최고 누적 연산 체인을 독립적으로 선택&lt;/li&gt;
&lt;/ol&gt;
&lt;div style=&quot;font-family: &amp;quot;Noto Sans KR&amp;quot;, &amp;quot;Apple SD Gothic Neo&amp;quot;, &amp;quot;Nanum Gothic&amp;quot;, 나눔고딕, &amp;quot;Malgun Gothic&amp;quot;; line-height: 1.9em; word-wrap: break-word;&quot;&gt;
앨리스의 사례에서 보았듯이, 거래가 끝나면 그 거래는 모든 비트코인 네트워크에 전파가 됩니다. 여기서 각 네트워크의 노드들은 받은걸 이웃 노드들에게 다시 전송을 하기 이전에, 1차적으로 스스로 검증을 합니다. 합의 프로세스의 첫 번째 단계이니다. 거래가 이미 소비되어 있으면 안되고, 거래크기는 MAX_BLOCK_SIZE보다 작아야 하고, 입력값이 출력값 총액보다 커야 하고, 해시가 0이면 안되고…등등…사토시와 오픈소스 커뮤니티가 발전시킨 수 많은 체크리스트들을 통해 유효한 거래들만 솎아 내고 다른 노드에게 전송을 합니다.&amp;nbsp;&lt;a href=&quot;https://github.com/bitcoin/bitcoin/blob/master/src/consensus/tx_verify.cpp&quot; style=&quot;border-bottom: 1px solid rgb(85, 85, 85); text-decoration-line: none;&quot;&gt;bitcoin/src/consensus/tx_verify.cpp 참조 - CheckTransaction, CheckTxInputs 등&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Noto Sans KR&amp;quot;, &amp;quot;Apple SD Gothic Neo&amp;quot;, &amp;quot;Nanum Gothic&amp;quot;, 나눔고딕, &amp;quot;Malgun Gothic&amp;quot;; line-height: 1.9em; word-wrap: break-word;&quot;&gt;
두번째 단계를 가려면 채굴이라는 것을 이해해야 합니다. 채굴은 뭘까요? 가끔 인터넷에 보면 어떤 중국인 채굴자가 알파고나 가지고 있을 법한 수 천대의 GPU로 무장한 장비를 구축하고 한 달 전기세를 몇 억 씩 내가며 채굴을 하는 사진을 보셨을 수도 있습니다. (실제 채굴자들은 중국인들이 다수를 차지합니다.) 흔히들 채굴이란 많은 컴퓨팅 파워를 가지고 수학적 계산을 통해 솔루션을 찾는 것이라는데, 그 무식한 돈 낭비를 왜 하는지, 어떻게 하는지 한번 살펴보겠습니다.&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Noto Sans KR&amp;quot;, &amp;quot;Apple SD Gothic Neo&amp;quot;, &amp;quot;Nanum Gothic&amp;quot;, 나눔고딕, &amp;quot;Malgun Gothic&amp;quot;; line-height: 1.9em; word-wrap: break-word;&quot;&gt;
본래 채굴 과정은 2가지 목적을 가지고 있습니다.&lt;/div&gt;
&lt;ol style=&quot;font-family: &amp;quot;Noto Sans KR&amp;quot;, &amp;quot;Apple SD Gothic Neo&amp;quot;, &amp;quot;Nanum Gothic&amp;quot;, 나눔고딕, &amp;quot;Malgun Gothic&amp;quot;; margin: 40px 0px; padding-left: 50px;&quot;&gt;
&lt;li style=&quot;word-wrap: break-word;&quot;&gt;거래를 담고 있는 블록이 충분한 계산력을 사용하여 확인될 때만 블록이 장부에 등재되고 신뢰를 형성한다.&lt;/li&gt;
&lt;li style=&quot;word-wrap: break-word;&quot;&gt;각 블록 내에서 새 비트코인을 생성한다. 즉, 화폐를 발행하는 역할을 한다.&lt;/li&gt;
&lt;/ol&gt;
&lt;div style=&quot;font-family: &amp;quot;Noto Sans KR&amp;quot;, &amp;quot;Apple SD Gothic Neo&amp;quot;, &amp;quot;Nanum Gothic&amp;quot;, 나눔고딕, &amp;quot;Malgun Gothic&amp;quot;; line-height: 1.9em; word-wrap: break-word;&quot;&gt;
무슨 소린가 싶습니다. 하나씩 살펴보지요.&lt;br /&gt;채굴의 기술적 목표는 블록 헤더 안에 있는&amp;nbsp;&lt;strong&gt;난이도 목표(target value)&lt;/strong&gt;&amp;nbsp;보다&amp;nbsp;&lt;strong&gt;낮은 블록 해시값&lt;/strong&gt;&amp;nbsp;이 나올수 있게 하는&amp;nbsp;&lt;strong&gt;난스(nonce)&lt;/strong&gt;&amp;nbsp;값을 찾는 것입니다. 이 요건에 맞는 난스를 찾기 위해 초당 수천 조에 달하는 테스트를 합니다. 좀 더 쉽게 설명하면 채굴은 블록 헤더를 반복적으로 해싱해서, 해시 결과값이 특정 목표치와 일치할 때까지(=목표보다 낮아질때까지) 하나의 매개변수, 즉 난스 값을 변화시키는 과정입니다.&lt;/div&gt;
&lt;blockquote style=&quot;background: rgb(238, 238, 238); border-left: 5px solid rgb(204, 204, 204); font-family: &amp;quot;Noto Sans KR&amp;quot;, &amp;quot;Apple SD Gothic Neo&amp;quot;, &amp;quot;Nanum Gothic&amp;quot;, 나눔고딕, &amp;quot;Malgun Gothic&amp;quot;; margin: 40px 0px; padding: 5px 30px;&quot;&gt;
&lt;div style=&quot;font-size: 16px; line-height: 1.9em; word-wrap: break-word;&quot;&gt;
프알못을 위해…해시란(hash)?&lt;br /&gt;해싱은 임의의 길이의 데이터를&amp;nbsp;&lt;strong&gt;고정된 길이&lt;/strong&gt;&amp;nbsp;의 데이터로 매핑하는 암호화 함수입니다. SHA256이라는 알고리즘을 통해 어떤 텍스트들도 16진수의 64개 고정된 문자로 변경해버립니다. 어떤 특정 입력에 대한 해시 결과는 늘 동일하지만, 해싱의 결과값으로 입력값을 찾아내는 것은 불가능합니다. 목표하는 해시 결과가 우연히 나타나기 위해선 입력값을 하나씩 바꿔가며(ex:입력값의 일부인 난스를 1씩 증가시켜보며) 무한히 테스트 해보는 수밖에 없습니다. 특정한 값을 얻기 위해 가능한 모든 값을 대입해 보는것이죠.(Brute Force)&lt;/div&gt;
&lt;/blockquote&gt;
&lt;div style=&quot;font-family: &amp;quot;Noto Sans KR&amp;quot;, &amp;quot;Apple SD Gothic Neo&amp;quot;, &amp;quot;Nanum Gothic&amp;quot;, 나눔고딕, &amp;quot;Malgun Gothic&amp;quot;; line-height: 1.9em; word-wrap: break-word;&quot;&gt;
간단한 파이썬 예시입니다.&lt;/div&gt;
&lt;div class=&quot;language-python highlighter-rouge&quot; style=&quot;font-family: &amp;quot;Noto Sans KR&amp;quot;, &amp;quot;Apple SD Gothic Neo&amp;quot;, &amp;quot;Nanum Gothic&amp;quot;, 나눔고딕, &amp;quot;Malgun Gothic&amp;quot;;&quot;&gt;
&lt;div class=&quot;highlight&quot; style=&quot;margin: 40px 0px;&quot;&gt;
&lt;pre class=&quot;highlight&quot; style=&quot;background-color: #f9f9f9; border: 1px solid rgb(221, 221, 221); font-family: Consolas, monospace, x; font-size: 0.8rem; line-height: 1.4; margin-bottom: 40px; margin-top: 40px; overflow-x: auto; padding: 1rem;&quot;&gt;&lt;code style=&quot;background: transparent; color: inherit; font-family: Consolas, monospace, x; padding: 0px;&quot;&gt;&lt;span class=&quot;c&quot; style=&quot;color: #999988; font-style: italic;&quot;&gt;# Python 2.7.1&lt;/span&gt;
&lt;span class=&quot;o&quot; style=&quot;font-weight: bold;&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;nn&quot; style=&quot;color: #555555;&quot;&gt;hashlib&lt;/span&gt;
&lt;span class=&quot;o&quot; style=&quot;font-weight: bold;&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;k&quot; style=&quot;font-weight: bold;&quot;&gt;print&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;hashlib&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;sha256&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot; style=&quot;color: #dd1144;&quot;&gt;&quot;I am Satoshi Nakamoto&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;hexdigest&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
&lt;span class=&quot;mi&quot; style=&quot;color: #009999;&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;d7c7ba21cbbcd75d14800b100252d5b428e5b1213d27c385bc141ca6b47989e&lt;/span&gt;

&lt;span class=&quot;c&quot; style=&quot;color: #999988; font-style: italic;&quot;&gt;# 문장에 숫자만 추가해도 해시값은 완전히 달라집니다&lt;/span&gt;
&lt;span class=&quot;o&quot; style=&quot;font-weight: bold;&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;k&quot; style=&quot;font-weight: bold;&quot;&gt;print&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;hashlib&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;sha256&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot; style=&quot;color: #dd1144;&quot;&gt;&quot;I am Satoshi Nakamoto1&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;hexdigest&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;f7bc9a6304a4647bb41241a677b5345fe3cd30db882c8281cf24fbb7645b6240&lt;/span&gt;

&lt;span class=&quot;o&quot; style=&quot;font-weight: bold;&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;k&quot; style=&quot;font-weight: bold;&quot;&gt;print&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;hashlib&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;sha256&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot; style=&quot;color: #dd1144;&quot;&gt;&quot;I am Satoshi Nakamoto2&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;hexdigest&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;ea758a8134b115298a1583ffb80ae62939a2d086273ef5a7b14fbfe7fb8a799e&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Noto Sans KR&amp;quot;, &amp;quot;Apple SD Gothic Neo&amp;quot;, &amp;quot;Nanum Gothic&amp;quot;, 나눔고딕, &amp;quot;Malgun Gothic&amp;quot;; line-height: 1.9em; word-wrap: break-word;&quot;&gt;
이제 해시가 뭔지를 감을 잡았습니다. 그럼 이제 변수로 사용되는 난스를 1씩 증가시켜보며 해시값이 어떻게 변하는지 살펴보겠습니다. 참고로 해시값은 모두 16진수입니다.(각 자리수가 0~f까지만 나올수 있다는 말.)&lt;/div&gt;
&lt;div class=&quot;highlighter-rouge&quot; style=&quot;font-family: &amp;quot;Noto Sans KR&amp;quot;, &amp;quot;Apple SD Gothic Neo&amp;quot;, &amp;quot;Nanum Gothic&amp;quot;, 나눔고딕, &amp;quot;Malgun Gothic&amp;quot;;&quot;&gt;
&lt;div class=&quot;highlight&quot; style=&quot;margin: 40px 0px;&quot;&gt;
&lt;pre class=&quot;highlight&quot; style=&quot;background-color: #f9f9f9; border: 1px solid rgb(221, 221, 221); font-family: Consolas, monospace, x; font-size: 0.8rem; line-height: 1.4; margin-bottom: 40px; margin-top: 40px; overflow-x: auto; padding: 1rem;&quot;&gt;&lt;code style=&quot;background: transparent; color: inherit; font-family: Consolas, monospace, x; padding: 0px;&quot;&gt;I am Satoshi Nakamoto0  =&amp;gt; a80a81401765c8eddee25df36728d73...
I am Satoshi Nakamoto1  =&amp;gt; f7bc9a6304a4647bb41241a677b5345...
I am Satoshi Nakamoto2  =&amp;gt; ea758a8134b115298a1583ffb80ae62...
I am Satoshi Nakamoto3  =&amp;gt; bfa9779618ff072c903d773de30c99b...
I am Satoshi Nakamoto4  =&amp;gt; bce8564de9a83c18c31944a66bde992...
I am Satoshi Nakamoto5  =&amp;gt; eb362c3cf3479be0a97a20163589038...
I am Satoshi Nakamoto6  =&amp;gt; 4a2fd48e3be420d0d28e202360cfbab...
I am Satoshi Nakamoto7  =&amp;gt; 790b5a1349a5f2b909bf74d0d166b17...
I am Satoshi Nakamoto8  =&amp;gt; 702c45e5b15aa54b625d68dd947f159...
I am Satoshi Nakamoto9  =&amp;gt; 7007cf7dd40f5e933cd89fff5b791ff...
I am Satoshi Nakamoto10 =&amp;gt; c2f38c81992f4614206a21537bd634a...
I am Satoshi Nakamoto11 =&amp;gt; 7045da6ed8a914690f087690e1e8d66...
I am Satoshi Nakamoto12 =&amp;gt; 60f01db30c1a0d4cbce2b4b22e88b9b...
I am Satoshi Nakamoto13 =&amp;gt; 0ebc56d59a34f5082aaef3d66b37a66...
I am Satoshi Nakamoto14 =&amp;gt; 27ead1ca85da66981fd9da01a8c6816...
I am Satoshi Nakamoto15 =&amp;gt; 394809fb809c5f83ce97ab554a2812c...
I am Satoshi Nakamoto16 =&amp;gt; 8fa4992219df33f50834465d3047429...
I am Satoshi Nakamoto17 =&amp;gt; dca9b8b4f8d8e1521fa4eaa46f4f0cd...
I am Satoshi Nakamoto18 =&amp;gt; 9989a401b2a3a318b01e9ca9a22b0f3...
I am Satoshi Nakamoto19 =&amp;gt; cda56022ecb5b67b2bc93a2d764e75f...
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Noto Sans KR&amp;quot;, &amp;quot;Apple SD Gothic Neo&amp;quot;, &amp;quot;Nanum Gothic&amp;quot;, 나눔고딕, &amp;quot;Malgun Gothic&amp;quot;; line-height: 1.9em; word-wrap: break-word;&quot;&gt;
만약&amp;nbsp;&lt;strong&gt;난이도 목표&lt;/strong&gt;&amp;nbsp;가 1000000000000000000000000000000000000000000000000000000000000000 라는 16진수라고 가정해봅니다. 맨 앞이 1로 시작한다는게 중요합니다. 내가 어떤 입력값을 해싱해서 이 난이도 목표값보다 낮은 해시값을 찾으려 합니다. 근데 해싱의 특성상 입력값을 유추하는건 불가능합니다. 위의 해싱 리스트에서 맨 앞자리가 1보다 작은 해시값은 뭔가요? 바로&amp;nbsp;&lt;strong&gt;I am Satoshi Nakamoto13&lt;/strong&gt;&amp;nbsp;뿐입니다.(해시 결과값이 0으로 시작하니 1보단 작은게 확실합니다) 답을 찾았습니다. 여기서 찾은 난스는 13입니다. 바로 이 것을&amp;nbsp;&lt;strong&gt;작업증명(Proof of Work)&lt;/strong&gt;&amp;nbsp;계산이라고 합니다. 16진수의 하나인 0이 나오는 것은 확률적으로 16번이면 나오는데 물론 13번만에 나왔으니 운이 좋긴 했지만 위의 결과가 보여주듯 요건을 만족하는 nonce를 찾는건 쉬운건 아닙니다. 맨 앞자리만 비교해서 13번만 연산한거지, 수치적으로 더 많은 자리수를 비교하려면 엄청난 연산이 필요한겁니다. 게다가 비트코인 시스템은 컴퓨팅 파워의 발전과 함께 더 경쟁이 치열해졌고, 그에 따라 난이도도 어려워지도록 설계되었습니다. 채굴이 어떤 건지 대충 감이 오시나요? 딴거 없습니다. 그냥 수학적 계산일 뿐이죠. 어떻게 보면 블록체인과는 아무 상관도 없고, 블록 안에 포함된 앨리스의 거래와는 아무 상관도 없는, 단순 노가다 계산일 뿐입니다.&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Noto Sans KR&amp;quot;, &amp;quot;Apple SD Gothic Neo&amp;quot;, &amp;quot;Nanum Gothic&amp;quot;, 나눔고딕, &amp;quot;Malgun Gothic&amp;quot;; line-height: 1.9em; word-wrap: break-word;&quot;&gt;
어떤 채굴자가 채굴에 성공(=난이도 목표보다 낮은 해시값을 찾는데 성공=작업증명에 성공)했다면 그 블록을 다른 네트워크 노드에 전달하게 됩니다. 당연히 블록 안에 있는 채굴자가 찾은 난스(여기서는 13이라는 숫자)도 전달됩니다. 그럼 다른 노드들은 그걸 검증하고 검증에 통과하면 각자 독립적으로 해당 블록을 거래장부에 추가합니다. 위에서 말한 합의 프로세스의 일부입니다. 근데 어떻게 검증을 할까요? 다른 채굴자들은 답을 못찾았는데 말입니다. 정답은, 그냥 정답을 찾은 채굴자에게 받은 난스를 가지고 자기도 해싱을 한 뒤, 그 결과값이 이전 블록의 난이도 목표보다 작다는 사실만 확인하면 됩니다. 이웃이 문제의 정답을 알려줬으니 쓰기만 하면 되는겁니다. 참 간단하죠. 작업을 검증하기 위해서는 단 1회의 해싱만 필요하지만, 유효한 난스를 찾는데는 13회, 아니 실제로는 수천 조, 수십 경이 넘는 해싱이 실행되야 합니다. 이게 바로 채굴과 합의입니다.&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Noto Sans KR&amp;quot;, &amp;quot;Apple SD Gothic Neo&amp;quot;, &amp;quot;Nanum Gothic&amp;quot;, 나눔고딕, &amp;quot;Malgun Gothic&amp;quot;; line-height: 1.9em; word-wrap: break-word;&quot;&gt;
이 글을 쓸 시점에는 블록 헤더의 해시가&amp;nbsp;&lt;a href=&quot;https://blockchain.info/block-index/1511480/0000000000000000013eeb173c0b78a79dcdc606f0ef50fc3a025610bf433f38&quot; style=&quot;border-bottom: 1px solid rgb(85, 85, 85); text-decoration-line: none;&quot;&gt;0000000000000000013eeb173c0b78a79dcdc606f0ef50fc3a025610bf433f38&lt;/a&gt;&amp;nbsp;인 블록의 난이도 목표보다 작은 블록에 대한 검색을 하고 있었습니다. 앞에 0이 엄청 있는것으로 보아 유효한 해시를 찾는게 엄청 어렵다는 걸 알 수 있습니다.&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Noto Sans KR&amp;quot;, &amp;quot;Apple SD Gothic Neo&amp;quot;, &amp;quot;Nanum Gothic&amp;quot;, 나눔고딕, &amp;quot;Malgun Gothic&amp;quot;; line-height: 1.9em; word-wrap: break-word;&quot;&gt;
또 의문이 생깁니다. 컴퓨팅 파워는 시간이 흐를수록 나날이 발전하고, 난스 찾는건 갈수록 어려워지는데, 어떻게 채굴 인터벌은 늘 평균적으로 10분을 유지하는 것일까요? 정답은 블록의 헤더 안에 있는 난이도 값 때문입니다. 비트코인 시스템은 사토시가 처음 만들 때부터 블록이 10분 단위로만 만들어지도록 설계되었습니다. 근데 해싱이란 것은 암호화된 값이기 때문에 우리가 볼 때는 복불복입니다. 억세게 운이 좋으면 원하는 결과 값이 빨리 나올 수 있고 운이 나쁘면 아무리 해도 원하는 값이 안나오겠죠. 비트코인 시스템은 이 난이도 값을 조정하며 블록이 평균적으로 10분마다 생성되도록 유지합니다. 근데 유지를 하다니, 누가유지를 하는 것인가요? 그것 역시 시스템 안에 설계되어 있습니다. 사토시는 2,016개의 블록이 10분 간격으로 만들어지는데 필요한 시간인 2주(2,016블록*10분)마다 난이도를 조절하도록 설계했습니다. 2주만에 만들어져야 할 2,016개의 블록이 1주만에 만들어졌다면 난이도는 올라가고, 한 3주걸렸다면 난이도는 줄어들도록 말이죠. 이에 따라 난이도 목표값도 재설정되는데, 블록을 찾는데 걸리는 시간을 측정, 계산하여 매번 난이도 목표값을 재설정합니다.&lt;/div&gt;
&lt;div class=&quot;language-cpp highlighter-rouge&quot; style=&quot;font-family: &amp;quot;Noto Sans KR&amp;quot;, &amp;quot;Apple SD Gothic Neo&amp;quot;, &amp;quot;Nanum Gothic&amp;quot;, 나눔고딕, &amp;quot;Malgun Gothic&amp;quot;;&quot;&gt;
&lt;div class=&quot;highlight&quot; style=&quot;margin: 40px 0px;&quot;&gt;
&lt;pre class=&quot;highlight&quot; style=&quot;background-color: #f9f9f9; border: 1px solid rgb(221, 221, 221); font-family: Consolas, monospace, x; font-size: 0.8rem; line-height: 1.4; margin-bottom: 40px; margin-top: 40px; overflow-x: auto; padding: 1rem;&quot;&gt;&lt;code style=&quot;background: transparent; color: inherit; font-family: Consolas, monospace, x; padding: 0px;&quot;&gt;&lt;span class=&quot;c1&quot; style=&quot;color: #999988; font-style: italic;&quot;&gt;// 작업증명 난이도 재설정 (bitcoin/src/pow.cpp 참조)
&lt;/span&gt;&lt;span class=&quot;kt&quot; style=&quot;color: #445588; font-weight: bold;&quot;&gt;unsigned&lt;/span&gt; &lt;span class=&quot;kt&quot; style=&quot;color: #445588; font-weight: bold;&quot;&gt;int&lt;/span&gt; &lt;span class=&quot;nf&quot; style=&quot;color: #990000; font-weight: bold;&quot;&gt;CalculateNextWorkRequired&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot; style=&quot;font-weight: bold;&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;CBlockIndex&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;font-weight: bold;&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;pindexLast&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kt&quot; style=&quot;color: #445588; font-weight: bold;&quot;&gt;int64_t&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;nFirstBlockTime&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;k&quot; style=&quot;font-weight: bold;&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Consensus&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;font-weight: bold;&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Params&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;font-weight: bold;&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;params&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;k&quot; style=&quot;font-weight: bold;&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;params&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;fPowNoRetargeting&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
        &lt;span class=&quot;k&quot; style=&quot;font-weight: bold;&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;pindexLast&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;font-weight: bold;&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;nBits&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;

    &lt;span class=&quot;c1&quot; style=&quot;color: #999988; font-style: italic;&quot;&gt;// Limit adjustment step
&lt;/span&gt;    &lt;span class=&quot;kt&quot; style=&quot;color: #445588; font-weight: bold;&quot;&gt;int64_t&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;nActualTimespan&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;font-weight: bold;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;pindexLast&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;font-weight: bold;&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;GetBlockTime&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;font-weight: bold;&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;nFirstBlockTime&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;k&quot; style=&quot;font-weight: bold;&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;nActualTimespan&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;font-weight: bold;&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;params&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;nPowTargetTimespan&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;font-weight: bold;&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;mi&quot; style=&quot;color: #009999;&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
        &lt;span class=&quot;n&quot;&gt;nActualTimespan&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;font-weight: bold;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;params&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;nPowTargetTimespan&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;font-weight: bold;&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;mi&quot; style=&quot;color: #009999;&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;k&quot; style=&quot;font-weight: bold;&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;nActualTimespan&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;font-weight: bold;&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;params&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;nPowTargetTimespan&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;font-weight: bold;&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;mi&quot; style=&quot;color: #009999;&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
        &lt;span class=&quot;n&quot;&gt;nActualTimespan&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;font-weight: bold;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;params&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;nPowTargetTimespan&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;font-weight: bold;&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;mi&quot; style=&quot;color: #009999;&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;

    &lt;span class=&quot;c1&quot; style=&quot;color: #999988; font-style: italic;&quot;&gt;// Retarget
&lt;/span&gt;    &lt;span class=&quot;k&quot; style=&quot;font-weight: bold;&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;arith_uint256&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;bnPowLimit&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;font-weight: bold;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;UintToArith256&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;params&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;powLimit&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;arith_uint256&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;bnNew&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;bnNew&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;SetCompact&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;pindexLast&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;font-weight: bold;&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;nBits&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;bnNew&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;font-weight: bold;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;bnNew&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;font-weight: bold;&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;nActualTimespan&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;bnNew&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;font-weight: bold;&quot;&gt;/=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;params&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;nPowTargetTimespan&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;

    &lt;span class=&quot;k&quot; style=&quot;font-weight: bold;&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;bnNew&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;font-weight: bold;&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;bnPowLimit&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
        &lt;span class=&quot;n&quot;&gt;bnNew&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;font-weight: bold;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;bnPowLimit&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;

    &lt;span class=&quot;k&quot; style=&quot;font-weight: bold;&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;bnNew&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;GetCompact&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;blockquote style=&quot;background: rgb(238, 238, 238); border-left: 5px solid rgb(204, 204, 204); font-family: &amp;quot;Noto Sans KR&amp;quot;, &amp;quot;Apple SD Gothic Neo&amp;quot;, &amp;quot;Nanum Gothic&amp;quot;, 나눔고딕, &amp;quot;Malgun Gothic&amp;quot;; margin: 40px 0px; padding: 5px 30px;&quot;&gt;
&lt;div style=&quot;font-size: 16px; line-height: 1.9em; word-wrap: break-word;&quot;&gt;
혹시 채굴할때 계산 방법이 ‘난이도 목표’보다 낮은 해시값을 찾는것인지, 그냥 ‘이전 블록의 해시값’보다 낮은 해시값을 찾는 것인지 헷갈릴 수 있습니다. 그 이유는 난이도 목표값이라는 항목 자체가 계수/지수 포맷으로 된 8자리 16진수 값이기 때문인데 이를 지수계산과 10진수 변환을 거친 후 다시 긴 16진수로 바꿔보면 결국 ‘이전 블록의 해시값’과 비스~읏 하게 나옵니다. 사실은 ‘난이도 목표’ 보다 낮은 해시값을 찾는게 맞습니다.&lt;/div&gt;
&lt;/blockquote&gt;
&lt;div style=&quot;font-family: &amp;quot;Noto Sans KR&amp;quot;, &amp;quot;Apple SD Gothic Neo&amp;quot;, &amp;quot;Nanum Gothic&amp;quot;, 나눔고딕, &amp;quot;Malgun Gothic&amp;quot;; line-height: 1.9em; word-wrap: break-word;&quot;&gt;
채굴의 목적을 설명하느라 길어졌네요. 그럼 위에서 언급한 채굴과정의 두 번째 목적, 화폐 발행 기능은 무슨 얘기일까요?&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Noto Sans KR&amp;quot;, &amp;quot;Apple SD Gothic Neo&amp;quot;, &amp;quot;Nanum Gothic&amp;quot;, 나눔고딕, &amp;quot;Malgun Gothic&amp;quot;; line-height: 1.9em; word-wrap: break-word;&quot;&gt;
&lt;img alt=&quot;비트코인 발행계획&quot; src=&quot;http://www.leejungmin.org/images/2017-05-30/msbt_0210.png&quot; style=&quot;max-width: 100%;&quot; title=&quot;비트코인 발행계획&quot; /&gt;&lt;br /&gt;출처 : 피넥터&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Noto Sans KR&amp;quot;, &amp;quot;Apple SD Gothic Neo&amp;quot;, &amp;quot;Nanum Gothic&amp;quot;, 나눔고딕, &amp;quot;Malgun Gothic&amp;quot;; line-height: 1.9em; word-wrap: break-word;&quot;&gt;
가상화폐인 비트코인의 총 발행량은 사토시가 처음 만들 때부터 2,100만 BTC로 정해져있는데, 2017년 현재 1600만 BTC 정도 발행이 된 상태입니다. 하나의 블록당 발행되는 비트코인은 현재 기준으로 약 12.5 BTC이며, 4년마다 반감기를 거쳐 2140년 정도 되면 발행이 끝나게 됩니다. 그 때가 되면 비트코인 발행 단위가 0.00000001 BTC(1사토시)가 될 만큼 줄어들기 떄문이죠.&lt;br /&gt;여하튼 누군가는 발행을 한다는건데, 이걸 누구에게, 어떤 방식으로 주는걸까요? 비트코인은 탈중앙화된 환경이라는데 한국은행 역할은 누가 하는 것이죠? 바로 10분마다 채굴되는 블록을 통해 발행하게 되어 있습니다. 블록이 하나 체인에 쌓일 때마다 비트코인의 일부가 발행이 되는 것이죠.&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Noto Sans KR&amp;quot;, &amp;quot;Apple SD Gothic Neo&amp;quot;, &amp;quot;Nanum Gothic&amp;quot;, 나눔고딕, &amp;quot;Malgun Gothic&amp;quot;; line-height: 1.9em; word-wrap: break-word;&quot;&gt;
앞서 얘기한 것처럼, 합의도출을 위한 분산화된 매커니즘을 갖고 있는 비트코인 생태계에선 누군가 계속 거래 장부를 만들어 나가는 노력을 해야 하는데, 이를 위한 방식으로는 작업증명 계산 프로세스를 사용하고 있습니다. 근데 채굴자들이 이걸 천문학적인 H/W 투자비용, 비싼 전기세 등을 바쳐가며 하는 이유는 뭘까요? 그 이유는 바로 10분마다 발행되는 이&amp;nbsp;&lt;del&gt;따끈따끈한&lt;/del&gt;&amp;nbsp;신생 화폐를 얻기 위해서입니다. 비트코인 생태계는 이 화폐발행 기능을 통해서 채굴자들이 작업증명 계산을 하도록 유인합니다. 채굴에 성공한(=작업증명에 1등으로 성공한) 채굴자에게는 새롭게 발행한 비트코인을 보상(Reward)으로 주는 것이죠. 현재 비트코인 기준 발행량이 12.5BTC이고 시세가 1BTC당 USD 3천불 정도 하니까 한 번 성공하면 대략 원화 4천만원이 넘는 돈을 얻을 수 있네요. 10분에 4천만원이면 할만하지 않나요? PC사양이 별로 좋지 않은 개인 채굴자들은 채굴 풀(Pool)이라는 공동채굴단에 참여해서 마치 펀드처럼 본인이 투자한 컴퓨팅 파워만큼(PC사양) 분배받을 수도 있습니다.&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Noto Sans KR&amp;quot;, &amp;quot;Apple SD Gothic Neo&amp;quot;, &amp;quot;Nanum Gothic&amp;quot;, 나눔고딕, &amp;quot;Malgun Gothic&amp;quot;; line-height: 1.9em; word-wrap: break-word;&quot;&gt;
어라? 이상하다. 비트코인은 중앙통제기구가 없는 생태계라는데 그럼 보상을 수여하는 주체는 누구일까요? 이 보상을 받는 방법은 의외로 간단한데,&amp;nbsp;&lt;strong&gt;채굴자가 자신이 만드려는 블록 안에, 보상으로 받을 새로운 비트코인이 “생성”되는 거래를 하나의 거래로써 포함시키는 것입니다.&lt;/strong&gt;&amp;nbsp;일종의 셀프 보상인 셈이죠. 하지만 그냥 거래를 블록에 포함시켰을 뿐, 아직 승인된 것은 아닙니다. 채굴에 성공해야 받게 됩니다. 그리고 엄밀히 얘기하면 보상금만 있는 것은 아니고, 보상금과 함께 자신의 블록 안에 있는 모든 거래들, 즉 10분동안 전 세계 각지에서 접수된 거래들의 거래수수료까지 포함을 해서 합친 금액을 생성합니다. 2140년이 되어 더 이상 채굴할 비트코인이 없어지는 시대가 오면, 거래수수료만 생성하게 될 것입니다. 이런 생성거래는 채굴자의 비트코인 주소로 전송하는 하나의 출력값을 가지고 있기 때문에, 나중에 채굴에 성공하면 결국 채굴자에게 돌아갑니다. 물론 채굴에 실패하면 아무것도 못 얻습니다.&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Noto Sans KR&amp;quot;, &amp;quot;Apple SD Gothic Neo&amp;quot;, &amp;quot;Nanum Gothic&amp;quot;, 나눔고딕, &amp;quot;Malgun Gothic&amp;quot;; line-height: 1.9em; word-wrap: break-word;&quot;&gt;
여기서 또 질문. 채굴하는 동안 쌓이는 거래는 어떻게 보관하고 있을까요? 네트워크로 전송된 거래는 블록체인에 올라가기 전까지는 검증되지 않습니다. 10분마다 새 블록이 생성될 때, 비트코인 네트워크 노드들은 이 상황을 지켜보다가 각 노드가 유지하고 있는 임시 풀(temporary pool)에 새로운 거래들을 추가시켜놓습니다. 물론 여기에는 미검증 거래들이 들어있겠죠. 거래들이 새 블록에 추가될 때는 거래의 age나(발생한지 얼마나 오래됐는지), 거래 수수료가 가장 높은 거래부터 우선적으로 추가되어(다른 기준도 있지만) 새로운 블록에 대한 작업증명 계산을 시작합니다. 만약 한창 계산하고 있는데, 억세게 운 좋은 다른 채굴자가 1분 만에 솔루션을 찾아서, 그 채굴자으로부터 새로운 블록을 받게 되면, ‘이번 라운드에서는 내가 실패했구나’ 깨닫고 재빨리 새 블록을 채굴하는 과정을 다시 시작합니다.&amp;nbsp;&lt;del&gt;과거 따위는 신경쓰지 않아&lt;/del&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Noto Sans KR&amp;quot;, &amp;quot;Apple SD Gothic Neo&amp;quot;, &amp;quot;Nanum Gothic&amp;quot;, 나눔고딕, &amp;quot;Malgun Gothic&amp;quot;; line-height: 1.9em; word-wrap: break-word;&quot;&gt;
다시 사토시의 합의 프로세스로 돌아오겠습니다.&lt;br /&gt;비트코인 합의 매커니즘의 세 번째 단계는 모든 노드들이 받은 새 블록을 독립적으로 검증하는 것입니다. 왜 채굴자들은 블록 안에 무수히 많은 비트코인을 자신에게 전송하는 거래를 만들지 않을까요? 그것은 모든 노드가 동일한 규칙에 따라 블록들을 검증하기 때문입니다. 블록의 데이터 구조가 문법적으로 유효한지, 블록의 크기는 제대로인지, 머클트리 해시값은 맞는지, 거래 전부는 다 유효한지…&amp;nbsp;&lt;a href=&quot;https://github.com/bitcoin/bitcoin/blob/c973cc5a43187f4cfd7d053da3f9e35aa3866590/src/validation.cpp&quot; style=&quot;border-bottom: 1px solid rgb(85, 85, 85); text-decoration-line: none;&quot;&gt;(bitcoin/src/validation.cpp 참조)&amp;nbsp;&lt;/a&gt;때문에 채굴자들은 사실 여부를 속일 수 없는 것이죠. 비싼 전기세 내고 조작했다간 아까운 기회비용만 날리는 것입니다. 채굴자들은 모든 노드가 따르고 있는 공유 규칙에 따라 완벽한 블록을 구성해야 하고 그 블록을 채굴하기 위해 노력해야 합니다.&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Noto Sans KR&amp;quot;, &amp;quot;Apple SD Gothic Neo&amp;quot;, &amp;quot;Nanum Gothic&amp;quot;, 나눔고딕, &amp;quot;Malgun Gothic&amp;quot;; line-height: 1.9em; word-wrap: break-word;&quot;&gt;
합의 프로세스의 마지막은 체인을 선택하는 일입니다. 체인은 왜 선택하는 걸까요? 블록체인은 분산화된 데이터 구조이므로 노드들이 각자 가지고 있는 복사본들이 서로 항상 동일한 상태를 유지하는 것은 아닙니다. 두 개의 블록이 각자 짧은 시간 내에 채굴되어 반대의 순서로 도착하거나, 여러가지 네트워크 환경에 따라 서로가 가지고 있는 블록체인이 불일치할 수 있습니다. 이 현상을 해결 하기 위해 각 노드는 여러 노드 중에서, 항상 작업증명을 가장 많이 시행한 노드의 블록체인을 선택해서 새로운 블록을 추가하려고 합니다. 이것을 최장 체인 혹은&amp;nbsp;&lt;strong&gt;최고 누적 난이도 체인(greatest cumulative difficulty chain)&lt;/strong&gt;&amp;nbsp;이라고 합니다. 모든 노드가 이 최장 누적난이도 체인을 선택하는 한, 전 세계 비트코인 네트워크는 결국 일관된 상태로 수렴합니다.&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Noto Sans KR&amp;quot;, &amp;quot;Apple SD Gothic Neo&amp;quot;, &amp;quot;Nanum Gothic&amp;quot;, 나눔고딕, &amp;quot;Malgun Gothic&amp;quot;; line-height: 1.9em; word-wrap: break-word;&quot;&gt;
한편, 이 합의도출 매커니즘을 기반으로 하는 비트코인 생태계는 사리사욕을 추구하지 않고 정직하게 작업하는 채굴자들이 다수를 차지한다는 신뢰를 바탕으로 하고 있습니다. 만약 특정 채굴자 집단이 채굴 파워 중 많은 부분을 획득하여 비트코인 네트워크의 보안을 위협하기 위해 합의 매커니즘을 공격한다면, 비트코인 생태계의 신뢰도는 크게 하락할 것이라는 비판이 있는 것도 사실입니다. 하지만 이에 대해 비트코인의 창시자인 사토시는 그의 논문에서 이렇게 설명합니다.&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Noto Sans KR&amp;quot;, &amp;quot;Apple SD Gothic Neo&amp;quot;, &amp;quot;Nanum Gothic&amp;quot;, 나눔고딕, &amp;quot;Malgun Gothic&amp;quot;; line-height: 1.9em; word-wrap: break-word;&quot;&gt;
“If a greedy attacker is able to assemble more CPU power than all the honest nodes, he would have to choose between using it to defraud people by stealing back his payments, or using it to generate new coins. He ought to find it more profitable to play by the rules, such rules that favour him with more new coins than everyone else combined, than to undermine the system and the validity of his own wealth.”&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Noto Sans KR&amp;quot;, &amp;quot;Apple SD Gothic Neo&amp;quot;, &amp;quot;Nanum Gothic&amp;quot;, 나눔고딕, &amp;quot;Malgun Gothic&amp;quot;; line-height: 1.9em; word-wrap: break-word;&quot;&gt;
“어느 탐욕스러운 공격자가 다른 모든 정직한 마이너들의 컴퓨팅 파워를 능가하게 된다면, 그는 가지고 있는 힘을 다른 이들의 비트코인을 훔치는 데에 사용할 지, 아니면 새로운 블록을 생성하여 코인을 획득하는 데 사용할 지를 선택해야 할 것이다. 그는 전체 시스템을 약화시킴으로써 자신이 보유한 비트코인의 가치를 떨어뜨리는 것 보다, 정해진 규칙에 따라 다른 모든 마이너들이 채굴할 수 있는 비트코인의 양보다 더 많은 코인을 확보함으로써 얻는 이익이 더 크다는 것을 알게 될 것이다.“&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Noto Sans KR&amp;quot;, &amp;quot;Apple SD Gothic Neo&amp;quot;, &amp;quot;Nanum Gothic&amp;quot;, 나눔고딕, &amp;quot;Malgun Gothic&amp;quot;; line-height: 1.9em; word-wrap: break-word;&quot;&gt;
&lt;img alt=&quot;블록체인 거래장부&quot; src=&quot;http://www.leejungmin.org/images/2017-05-30/msbt_0209.png&quot; style=&quot;max-width: 100%;&quot; title=&quot;블록체인 거래장부&quot; /&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Noto Sans KR&amp;quot;, &amp;quot;Apple SD Gothic Neo&amp;quot;, &amp;quot;Nanum Gothic&amp;quot;, 나눔고딕, &amp;quot;Malgun Gothic&amp;quot;; line-height: 1.9em; word-wrap: break-word;&quot;&gt;
위의 그림을 살펴보면, 앨리스의 거래가 들어 있는 블록 #277316을 볼 수 있습니다. 최초 블록이 #0부터니까 앨리스의 거래 블록까지 277,316개의 블록이 존재한다고 볼 수 있으며 모두가 체인으로 연결되어 있습니다. 시간이 흘러 블록이 많아지면서 거래들의 신뢰도가 더 높아지고, 거래를 철회하기도 기하급수적으로 어려워집니다(관례상 6개의 블록 이전까지의 거래는 철회할 수 없다고 알려져 있음)&lt;/div&gt;
&lt;hr style=&quot;border-bottom-color: rgb(0, 0, 0); border-bottom-style: solid; border-image: initial; border-left: 0px; border-right: 0px; border-top: 0px; font-family: &amp;quot;Noto Sans KR&amp;quot;, &amp;quot;Apple SD Gothic Neo&amp;quot;, &amp;quot;Nanum Gothic&amp;quot;, 나눔고딕, &amp;quot;Malgun Gothic&amp;quot;; margin: 30px 0px;&quot; /&gt;
&lt;div style=&quot;font-family: &amp;quot;Noto Sans KR&amp;quot;, &amp;quot;Apple SD Gothic Neo&amp;quot;, &amp;quot;Nanum Gothic&amp;quot;, 나눔고딕, &amp;quot;Malgun Gothic&amp;quot;; line-height: 1.9em; word-wrap: break-word;&quot;&gt;
여기까지 대략적인 비트코인 작동원리에 대해 살펴보았습니다. 비트코인은 이론이 아니고 이미 현실화된 화폐시장입니다.&amp;nbsp;&lt;a href=&quot;https://blockchain.info/ko&quot; style=&quot;border-bottom: 1px solid rgb(85, 85, 85); text-decoration-line: none;&quot;&gt;블록체인 탐색기&lt;/a&gt;를 이용하면 어떤 거래든, 블록이든, 해시든, 다 검색이 가능하니 직접 사용해 보면 이해가 더 쉽게 가능합니다. 비트코인 코어 클라이언트를 설치할 줄 안다면 json-rpc 인터페이스를 이용해서 원하는 정보를 데이터 형태로 조회할 수 있습니다.&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Noto Sans KR&amp;quot;, &amp;quot;Apple SD Gothic Neo&amp;quot;, &amp;quot;Nanum Gothic&amp;quot;, 나눔고딕, &amp;quot;Malgun Gothic&amp;quot;; line-height: 1.9em; word-wrap: break-word;&quot;&gt;
비트코인, 더 나아가 블록체인의 미래는 누구도 확신할 수 없습니다. 비트코인은 현대 암호학과 IT기술, 계량경제학 등의 집약체이지만 아직도 많은 논의가 필요해보입니다. 한 쪽에서는 블록체인 거버넌스를 얘기하지만 다른 한 쪽에서는 비트코인 버블론, 종말론을 이야기합니다. 비트코인의 발행총량이 서서히 끝나가는 이 시점에, 과연 본격적인 디플레이션이 올지, 앞으로 디지털 현물자산의 법적 보증은 누가 할지, 스마트 컨트랙트를 탑재한 이더리움은 법률적 효력이 있을지 아직 아무도 알 수 없습니다. 계좌동결이나 강제인도 같은 현실 금융시장에서 필요한 기능이 비트코인 생태계에서 지원되지 않는 점도 큰 문제입니다. 하지만 그럼에도 불구하고 비트코인은 수 많은 집단지성에 의해 발전하고 있습니다.&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://bridroid.blogspot.com/feeds/4020273647346333616/comments/default' title='댓글'/><link rel='replies' type='text/html' href='http://bridroid.blogspot.com/2018/02/blog-post.html#comment-form' title='0개의 덧글'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/905901812770512183/posts/default/4020273647346333616'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/905901812770512183/posts/default/4020273647346333616'/><link rel='alternate' type='text/html' href='http://bridroid.blogspot.com/2018/02/blog-post.html' title='비트코인'/><author><name>brith1225</name><uri>http://www.blogger.com/profile/15293023387175369557</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-905901812770512183.post-3018731110221399611</id><published>2018-01-11T16:51:00.001-08:00</published><updated>2018-01-11T16:51:23.350-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="jsessionname"/><category scheme="http://www.blogger.com/atom/ns#" term="session"/><category scheme="http://www.blogger.com/atom/ns#" term="sessionCookieName"/><category scheme="http://www.blogger.com/atom/ns#" term="sessionname"/><category scheme="http://www.blogger.com/atom/ns#" term="tomcat"/><title type='text'>tomcat  sessionCookieName</title><content type='html'>&amp;lt;Context docBase=&quot;test&quot; path=&quot;/&quot; reloadable=&quot;true&quot; source=&quot;org.eclipse.jst.jee.server:test sessionCookieName=&quot;test_egov_JSESSIONID&quot; /&amp;gt;</content><link rel='replies' type='application/atom+xml' href='http://bridroid.blogspot.com/feeds/3018731110221399611/comments/default' title='댓글'/><link rel='replies' type='text/html' href='http://bridroid.blogspot.com/2018/01/tomcat-sessioncookiename.html#comment-form' title='0개의 덧글'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/905901812770512183/posts/default/3018731110221399611'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/905901812770512183/posts/default/3018731110221399611'/><link rel='alternate' type='text/html' href='http://bridroid.blogspot.com/2018/01/tomcat-sessioncookiename.html' title='tomcat  sessionCookieName'/><author><name>brith1225</name><uri>http://www.blogger.com/profile/15293023387175369557</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-905901812770512183.post-3473320829601313503</id><published>2018-01-10T23:24:00.002-08:00</published><updated>2018-01-10T23:24:23.640-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="totalcommander"/><category scheme="http://www.blogger.com/atom/ns#" term="토탈커맨더"/><title type='text'>토탈커맨더_기능</title><content type='html'>&lt;br /&gt;
&lt;div id=&quot;postViewArea&quot; style=&quot;background-color: #a9c6d9;&quot;&gt;
&lt;div class=&quot;post-view pcol2 _param(1) _postViewArea30073139792&quot; id=&quot;post-view30073139792&quot; style=&quot;clear: both; color: #404040; font-family: 돋움; font-size: 12px; line-height: 1.5; margin: 0px 0px 15px; overflow-x: auto; overflow-y: hidden; padding: 15px 0px; position: relative; text-align: justify; width: 744px; word-wrap: break-word;&quot;&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 1.5; padding: 0px;&quot;&gt;
&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 12pt;&quot;&gt;ALT&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;조합&lt;span lang=&quot;EN-US&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 1.5; padding: 0px;&quot;&gt;
&lt;b&gt;&lt;span lang=&quot;EN-US&quot;&gt;Alt + F1&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;&lt;/span&gt;왼쪽 패널 드라이브 바꾸기&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 1.5; padding: 0px;&quot;&gt;
&lt;b&gt;&lt;span lang=&quot;EN-US&quot;&gt;Alt + F2&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;&lt;/span&gt;오른쪽 패널 드라이브 바꾸기&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 1.5; padding: 0px;&quot;&gt;
&lt;b&gt;&lt;span lang=&quot;EN-US&quot;&gt;Alt + left/right :&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;&lt;/span&gt;작업한 폴더 간에 앞으로&lt;span lang=&quot;EN-US&quot;&gt;,&amp;nbsp;&lt;/span&gt;뒤로 이동하기&lt;span lang=&quot;EN-US&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 1.5; padding: 0px;&quot;&gt;
&lt;b&gt;&lt;span lang=&quot;EN-US&quot;&gt;Alt + BackSpace :&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;&lt;/span&gt;한 단계 상위 폴더로 이동하기&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 1.5; padding: 0px;&quot;&gt;
&lt;b&gt;&lt;span lang=&quot;EN-US&quot;&gt;Alt + down&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;&lt;/span&gt;작업했던 폴더 리스트 보여주기&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 1.5; padding: 0px;&quot;&gt;
&lt;b&gt;&lt;span lang=&quot;EN-US&quot;&gt;Alt + Shift + Enter :&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;&lt;/span&gt;현재 폴더 안의 모든 하부 폴더의 용량을&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;&amp;lt;DIR&amp;gt;&amp;nbsp;&lt;/span&gt;표시 대신에 보여줍니다&lt;span lang=&quot;EN-US&quot;&gt;.&amp;nbsp;&lt;/span&gt;대신&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;‘full’&amp;nbsp;&lt;/span&gt;보기 모드일 때만 가능&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 1.5; padding: 0px;&quot;&gt;
&lt;b&gt;&lt;span lang=&quot;EN-US&quot;&gt;Alt + ENTER :&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;&lt;/span&gt;파일 속성 보기&lt;span lang=&quot;EN-US&quot;&gt;,&amp;nbsp;&lt;/span&gt;단축 메뉴의 속성과 동일한 기능&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 1.5; padding: 0px;&quot;&gt;
&lt;b&gt;&lt;span lang=&quot;EN-US&quot;&gt;Alt + F4&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;&lt;/span&gt;토탈 커맨더 종료&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 1.5; padding: 0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 1.5; padding: 0px;&quot;&gt;
&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 12pt;&quot;&gt;CTRL&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;조합&lt;span lang=&quot;EN-US&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 1.5; padding: 0px;&quot;&gt;
&lt;b&gt;&lt;span lang=&quot;EN-US&quot;&gt;Ctrl + F1&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;&#39;brief&#39;&amp;nbsp;&lt;/span&gt;형식으로 리스트 보기&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 1.5; padding: 0px;&quot;&gt;
&lt;b&gt;&lt;span lang=&quot;EN-US&quot;&gt;Ctrl + F2&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;&#39;full&#39;&amp;nbsp;&lt;/span&gt;형식으로 리스트 보기&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 1.5; padding: 0px;&quot;&gt;
&lt;b&gt;&lt;span lang=&quot;EN-US&quot;&gt;Ctrl + Shift + F2&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;&lt;/span&gt;파일 주석 보기&lt;span lang=&quot;EN-US&quot;&gt;, Ctrl + Z&lt;/span&gt;로 주석을 달 수도 있음&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 1.5; padding: 0px;&quot;&gt;
&lt;b&gt;&lt;span lang=&quot;EN-US&quot;&gt;Ctrl + F3&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;&lt;/span&gt;이름으로 리스트 정렬&lt;span lang=&quot;EN-US&quot;&gt;,&amp;nbsp;&lt;/span&gt;그냥 리스트 위에&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;Name&amp;nbsp;&lt;/span&gt;탭을 클릭하면 된다&lt;span lang=&quot;EN-US&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 1.5; padding: 0px;&quot;&gt;
&lt;b&gt;&lt;span lang=&quot;EN-US&quot;&gt;Ctrl + F4&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;&lt;/span&gt;확장자로 리스트 정렬&lt;span lang=&quot;EN-US&quot;&gt;,&amp;nbsp;&lt;/span&gt;그냥 리스트 위에&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;Ext&amp;nbsp;&lt;/span&gt;탭을 클릭하면 된다&lt;span lang=&quot;EN-US&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 1.5; padding: 0px;&quot;&gt;
&lt;b&gt;&lt;span lang=&quot;EN-US&quot;&gt;Ctrl + F5&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;&lt;/span&gt;날짜&lt;span lang=&quot;EN-US&quot;&gt;/&lt;/span&gt;시간으로 정렬&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 1.5; padding: 0px;&quot;&gt;
&lt;b&gt;&lt;span lang=&quot;EN-US&quot;&gt;Ctrl + F6&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;&lt;/span&gt;파일 크기로 정렬&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 1.5; padding: 0px;&quot;&gt;
&lt;b&gt;&lt;span lang=&quot;EN-US&quot;&gt;Ctrl + F7&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;&lt;/span&gt;정렬 않기&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 1.5; padding: 0px;&quot;&gt;
&lt;b&gt;&lt;span lang=&quot;EN-US&quot;&gt;Ctrl + F8&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;&lt;/span&gt;반대쪽 패널에 탐색기 형식으로 폴더 구조 보여주기&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 1.5; padding: 0px;&quot;&gt;
&lt;b&gt;&lt;span lang=&quot;EN-US&quot;&gt;Ctrl + F9&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;&lt;/span&gt;현재 커서 아래 파일을 연결 프로그램을 이용해 프린트하기&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 1.5; padding: 0px;&quot;&gt;
&lt;b&gt;&lt;span lang=&quot;EN-US&quot;&gt;Ctrl + F10&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;&lt;/span&gt;모든 파일 보여주기&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 1.5; padding: 0px;&quot;&gt;
&lt;b&gt;&lt;span lang=&quot;EN-US&quot;&gt;Ctrl + F11&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;&lt;/span&gt;실행파일만 보여주기&lt;span lang=&quot;EN-US&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 1.5; padding: 0px;&quot;&gt;
&lt;b&gt;&lt;span lang=&quot;EN-US&quot;&gt;Ctrl + F12&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;&lt;/span&gt;정의된 파일만 보여주기&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 1.5; padding: 0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 1.5; padding: 0px;&quot;&gt;
&lt;b&gt;&lt;span lang=&quot;EN-US&quot;&gt;Ctrl + B&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;&lt;/span&gt;현재 패널에 하부 폴더의 리스트를 포함한 모든 파일 리스트 보여주기&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 1.5; padding: 0px;&quot;&gt;
&lt;b&gt;&lt;span lang=&quot;EN-US&quot;&gt;Ctrl+Q :&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;&lt;/span&gt;파일 내용 빠르게 보기&lt;span lang=&quot;EN-US&quot;&gt;,&amp;nbsp;&lt;/span&gt;텍스트 문서나 이미지 파일 등을 반대쪽 패널에서 볼 수 있다&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 1.5; padding: 0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 1.5; padding: 0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 1.5; padding: 0px;&quot;&gt;
&lt;b&gt;&lt;span lang=&quot;EN-US&quot;&gt;Ctrl + T&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;&lt;/span&gt;새 폴더 탭 열기&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;(&lt;/span&gt;활성화&lt;span lang=&quot;EN-US&quot;&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 1.5; padding: 0px;&quot;&gt;
&lt;b&gt;&lt;span lang=&quot;EN-US&quot;&gt;Ctrl + Shift + T&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;&lt;/span&gt;새 폴더 탭 열기&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;(&lt;/span&gt;활성화 하지 않음&lt;span lang=&quot;EN-US&quot;&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 1.5; padding: 0px;&quot;&gt;
&lt;b&gt;&lt;span lang=&quot;EN-US&quot;&gt;Ctrl + U&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;&lt;/span&gt;패널끼리 리스트 서로 바꾸기&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 1.5; padding: 0px;&quot;&gt;
&lt;b&gt;&lt;span lang=&quot;EN-US&quot;&gt;Ctrl + Shift + U&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;&lt;/span&gt;패널끼리 리스트도 바꾸기 탭도 바꾸기&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 1.5; padding: 0px;&quot;&gt;
&lt;b&gt;&lt;span lang=&quot;EN-US&quot;&gt;Ctrl + W&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;&lt;/span&gt;현재 활성화된 탭 닫기&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 1.5; padding: 0px;&quot;&gt;
&lt;b&gt;&lt;span lang=&quot;EN-US&quot;&gt;Ctrl + Shift + W&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;&lt;/span&gt;모든 탭 닫기&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 1.5; padding: 0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 1.5; padding: 0px;&quot;&gt;
&lt;b&gt;&lt;span lang=&quot;EN-US&quot;&gt;Ctrl + D&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;&lt;/span&gt;디렉토리 핫리스트 열기&lt;span lang=&quot;EN-US&quot;&gt;,&amp;nbsp;&lt;/span&gt;자주 가는 폴더 등록시켜놓고 바로 가기&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 1.5; padding: 0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 1.5; padding: 0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 1.5; padding: 0px;&quot;&gt;
&lt;b&gt;&lt;span lang=&quot;EN-US&quot;&gt;Ctrl + P :&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;&lt;/span&gt;현재 폴더 경로를 커맨드 라인에 붙여넣기&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 1.5; padding: 0px;&quot;&gt;
&lt;b&gt;&lt;span lang=&quot;EN-US&quot;&gt;Ctrl + Enter :&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;&lt;/span&gt;현재 커서의 파일명을 커맨드 라인에 붙여넣기&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 1.5; padding: 0px;&quot;&gt;
&lt;b&gt;&lt;span lang=&quot;EN-US&quot;&gt;Ctrl + Shift + Enter :&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;&lt;/span&gt;현재 커서의 파일명을 폴더명 포함해서 커맨드 라인에 붙여넣기&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 1.5; padding: 0px;&quot;&gt;
&lt;b&gt;&lt;span lang=&quot;EN-US&quot;&gt;Ctrl + \ :&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;&lt;/span&gt;루트 폴더로 이동하기&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 1.5; padding: 0px;&quot;&gt;
&lt;b&gt;&lt;span lang=&quot;EN-US&quot;&gt;Ctrl + PageUp&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;:&amp;nbsp;&lt;/span&gt;루트 폴더로 이동하기&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;(&lt;/span&gt;위와 동일 기능&lt;span lang=&quot;EN-US&quot;&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 1.5; padding: 0px;&quot;&gt;
&lt;b&gt;&lt;span lang=&quot;EN-US&quot;&gt;Ctrl + left/right :&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;&lt;/span&gt;현재 커서가 위치한 폴더나 압축 파일의 내용을 반대편 패널에서 열기&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 1.5; padding: 0px;&quot;&gt;
&lt;b&gt;&lt;span lang=&quot;EN-US&quot;&gt;Ctrl + L :&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;&lt;/span&gt;선택한 파일과 폴더의 총 용량 보여주기&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 1.5; padding: 0px;&quot;&gt;
&lt;b&gt;&lt;span lang=&quot;EN-US&quot;&gt;Ctrl + UP&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;&lt;/span&gt;현재 커서의 폴더를 새 탭으로 열기&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 1.5; padding: 0px;&quot;&gt;
&lt;b&gt;&lt;span lang=&quot;EN-US&quot;&gt;Ctrl + Shift + UP&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;&lt;/span&gt;현재 커서의 폴더를 다른 패널에 새 탭으로 열기&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 1.5; padding: 0px;&quot;&gt;
&lt;b&gt;&lt;span lang=&quot;EN-US&quot;&gt;Ctrl + TAB&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;&lt;/span&gt;다음 탭으로 이동&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 1.5; padding: 0px;&quot;&gt;
&lt;b&gt;&lt;span lang=&quot;EN-US&quot;&gt;Ctrl + Shift + TAB&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;&lt;/span&gt;이전 탭으로 이동&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 1.5; padding: 0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 1.5; padding: 0px;&quot;&gt;
&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 12pt;&quot;&gt;Function Key&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;조합&lt;span lang=&quot;EN-US&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 1.5; padding: 0px;&quot;&gt;
&lt;b&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;F3 :&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;&lt;/span&gt;텍스트 문서 보기&lt;span lang=&quot;EN-US&quot;&gt;,&amp;nbsp;&lt;/span&gt;이미지 파일 보기&lt;span lang=&quot;EN-US&quot;&gt;,&amp;nbsp;&lt;/span&gt;사운드 파일 듣기 등을 할 수 있는 종합 뷰어&lt;span lang=&quot;EN-US&quot;&gt;.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 1.5; padding: 0px;&quot;&gt;
&lt;b&gt;&lt;span lang=&quot;EN-US&quot;&gt;Alt + F3&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;&lt;/span&gt;다른 파일 뷰어&lt;span lang=&quot;EN-US&quot;&gt;(&lt;/span&gt;외부 뷰어&lt;span lang=&quot;EN-US&quot;&gt;)&amp;nbsp;&lt;/span&gt;사용하기&lt;span lang=&quot;EN-US&quot;&gt;,&amp;nbsp;&lt;/span&gt;이건 옵션에서 지정&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 1.5; padding: 0px;&quot;&gt;
&lt;b&gt;&lt;span lang=&quot;EN-US&quot;&gt;Shift + F3&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;&lt;/span&gt;여러 개의 파일이 범위로 선택되어 있을 경우&lt;span lang=&quot;EN-US&quot;&gt;,&amp;nbsp;&lt;/span&gt;현재 커서가 위치한 파일만 본다&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 1.5; padding: 0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 1.5; padding: 0px;&quot;&gt;
&lt;b&gt;&lt;span lang=&quot;EN-US&quot;&gt;F4&amp;nbsp;&lt;/span&gt;&lt;/b&gt;기본은 텍스트 파일 편집하기&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 1.5; padding: 0px;&quot;&gt;
&lt;b&gt;&lt;span lang=&quot;EN-US&quot;&gt;Shift + F4&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;&lt;/span&gt;텍스트 문서 하나 생성하기&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 1.5; padding: 0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 1.5; padding: 0px;&quot;&gt;
&lt;b&gt;&lt;span lang=&quot;EN-US&quot;&gt;F5 :&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;&lt;/span&gt;파일 복사하기&lt;span lang=&quot;EN-US&quot;&gt;,&amp;nbsp;&lt;/span&gt;압축 파일 내에서 필요한 파일만 압축을 해제하는 데에도 유용&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 1.5; padding: 0px;&quot;&gt;
&lt;b&gt;&lt;span lang=&quot;EN-US&quot;&gt;Shift + F5&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;&lt;/span&gt;같은 폴더 아래 파일 이름만 바꿔서 복사하기&lt;span lang=&quot;EN-US&quot;&gt;.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 1.5; padding: 0px;&quot;&gt;
&lt;b&gt;&lt;span lang=&quot;EN-US&quot;&gt;Ctrl + Shift + F5&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;&lt;/span&gt;선택한 파일의 링크 파일 만들기&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 1.5; padding: 0px;&quot;&gt;
&lt;b&gt;&lt;span lang=&quot;EN-US&quot;&gt;Alt+ F5 :&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;&lt;/span&gt;선택한 파일들로 압축 파일 만들기&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;(&lt;/span&gt;나중에 다시&lt;span lang=&quot;EN-US&quot;&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 1.5; padding: 0px;&quot;&gt;
&lt;b&gt;&lt;span lang=&quot;EN-US&quot;&gt;Alt + Shift + F5&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;&lt;/span&gt;파일 압축하기&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 1.5; padding: 0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 1.5; padding: 0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 1.5; padding: 0px;&quot;&gt;
&lt;b&gt;&lt;span lang=&quot;EN-US&quot;&gt;F6 :&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;&lt;/span&gt;선택한 파일들을 반대쪽으로 이동&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 1.5; padding: 0px;&quot;&gt;
&lt;b&gt;&lt;span lang=&quot;EN-US&quot;&gt;Shift + F6 :&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;&lt;/span&gt;선택한 파일 이름을 그 자리에서 직접 바꾸기&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 1.5; padding: 0px;&quot;&gt;
&lt;b&gt;&lt;span lang=&quot;EN-US&quot;&gt;Ctrl + M :&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;&lt;/span&gt;파일명 일괄적으로 바꾸기&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 1.5; padding: 0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 1.5; padding: 0px;&quot;&gt;
&lt;b&gt;&lt;span lang=&quot;EN-US&quot;&gt;F7 :&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;&lt;/span&gt;새 폴더 만들기&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 1.5; padding: 0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 1.5; padding: 0px;&quot;&gt;
&lt;b&gt;&lt;span lang=&quot;EN-US&quot;&gt;F8 :&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;&lt;/span&gt;파일 삭제하기&lt;span lang=&quot;EN-US&quot;&gt;,&amp;nbsp;&lt;/span&gt;휴지통으로 이동&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 1.5; padding: 0px;&quot;&gt;
&lt;b&gt;&lt;span lang=&quot;EN-US&quot;&gt;Shift + F8 :&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;&lt;/span&gt;파일 완전 삭제&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 1.5; padding: 0px;&quot;&gt;
&lt;b&gt;&lt;span lang=&quot;EN-US&quot;&gt;Alt + F8&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;&lt;/span&gt;커맨드 라인의 히스토리를 보여주기&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 1.5; padding: 0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 1.5; padding: 0px;&quot;&gt;
&lt;b&gt;&lt;span lang=&quot;EN-US&quot;&gt;Alt + F7 :&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;&lt;/span&gt;파일 검색&lt;span lang=&quot;EN-US&quot;&gt;,&amp;nbsp;&lt;/span&gt;원하는 파일명으로 찾기&lt;span lang=&quot;EN-US&quot;&gt;,&amp;nbsp;&lt;/span&gt;폴더&lt;span lang=&quot;EN-US&quot;&gt;-&lt;/span&gt;파일 크기&lt;span lang=&quot;EN-US&quot;&gt;-&lt;/span&gt;날짜&lt;span lang=&quot;EN-US&quot;&gt;-&lt;/span&gt;속성 등으로 고급 검색하기&lt;span lang=&quot;EN-US&quot;&gt;,&amp;nbsp;&lt;/span&gt;파일 내에 있는 문자열로 찾기 등 다양한 검색 기능을 제공&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 1.5; padding: 0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 1.5; padding: 0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 1.5; padding: 0px;&quot;&gt;
&lt;b&gt;&lt;span lang=&quot;EN-US&quot;&gt;Alt + F9 :&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;&lt;/span&gt;압축 파일 풀기&lt;span lang=&quot;EN-US&quot;&gt;,&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 1.5; padding: 0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 1.5; padding: 0px;&quot;&gt;
&lt;b&gt;&lt;span lang=&quot;EN-US&quot;&gt;Alt + F10:&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;&lt;/span&gt;더 트리 구조로 열기&lt;span lang=&quot;EN-US&quot;&gt;,&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 1.5; padding: 0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 1.5; padding: 0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 1.5; padding: 0px;&quot;&gt;
&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 12pt;&quot;&gt;Shift&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;조합&lt;span lang=&quot;EN-US&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 1.5; padding: 0px;&quot;&gt;
&lt;b&gt;&lt;span lang=&quot;EN-US&quot;&gt;Shift + F2 :&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;&lt;/span&gt;두 패널간에 파일 리스트 비교하기&lt;span lang=&quot;EN-US&quot;&gt;.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 1.5; padding: 0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 1.5; padding: 0px;&quot;&gt;
&lt;b&gt;&lt;span lang=&quot;EN-US&quot;&gt;Shift + F10 :&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;&lt;/span&gt;단축 메뉴 보여주기&lt;span lang=&quot;EN-US&quot;&gt;,&amp;nbsp;&lt;/span&gt;즉 마우스 오른쪽 버튼을 누르면 나오는 팝업 메뉴&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 1.5; padding: 0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 1.5; padding: 0px;&quot;&gt;
&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 12pt;&quot;&gt;NUM&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;조합&lt;span lang=&quot;EN-US&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 1.5; padding: 0px;&quot;&gt;
&lt;b&gt;&lt;span lang=&quot;EN-US&quot;&gt;NUM + :&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;&lt;/span&gt;특정 파일만 일괄 선택하기&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 1.5; padding: 0px;&quot;&gt;
&lt;b&gt;&lt;span lang=&quot;EN-US&quot;&gt;NUM - :&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;&lt;/span&gt;특정 파일만 일괄 선택 해제하기&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 1.5; padding: 0px;&quot;&gt;
&lt;b&gt;&lt;span lang=&quot;EN-US&quot;&gt;NUM *&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;&lt;/span&gt;파일 선택 반전시키기&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 1.5; padding: 0px;&quot;&gt;
&lt;b&gt;&lt;span lang=&quot;EN-US&quot;&gt;NUM /&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;&lt;/span&gt;선택 복구&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 1.5; padding: 0px;&quot;&gt;
&lt;b&gt;&lt;span lang=&quot;EN-US&quot;&gt;Ctrl+ NUM +&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;:&amp;nbsp;&lt;/span&gt;모두 선택하기&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 1.5; padding: 0px;&quot;&gt;
&lt;b&gt;&lt;span lang=&quot;EN-US&quot;&gt;Ctrl+ NUM - :&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;&lt;/span&gt;모두 선택 해제하기&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 1.5; padding: 0px;&quot;&gt;
&lt;b&gt;&lt;span lang=&quot;EN-US&quot;&gt;Alt + NUM +&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;&lt;/span&gt;현재 커서가 위치한 파일과 동일한 확장자의 모든 파일 선택하기&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 1.5; padding: 0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 1.5; padding: 0px;&quot;&gt;
&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 12pt;&quot;&gt;FTP&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;관련&lt;span lang=&quot;EN-US&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 1.5; padding: 0px;&quot;&gt;
&lt;b&gt;&lt;span lang=&quot;EN-US&quot;&gt;Ctrl + F :&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;FTP&amp;nbsp;&lt;/span&gt;접속&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 1.5; padding: 0px;&quot;&gt;
&lt;b&gt;&lt;span lang=&quot;EN-US&quot;&gt;Ctrl + Shift + F :&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;FTP&amp;nbsp;&lt;/span&gt;접속 해제&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 1.5; padding: 0px;&quot;&gt;
&lt;b&gt;&lt;span lang=&quot;EN-US&quot;&gt;Ctrl + Shift + M&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;FTP&amp;nbsp;&lt;/span&gt;전송 모드 바꾸기&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 1.5; padding: 0px;&quot;&gt;
&lt;b&gt;&lt;span lang=&quot;EN-US&quot;&gt;Ctrl + N&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;&lt;/span&gt;새로운&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp;FTP&amp;nbsp;&lt;/span&gt;연결&lt;/div&gt;
&lt;div style=&quot;line-height: 1.5; padding: 0px;&quot;&gt;
&lt;/div&gt;
&lt;div style=&quot;line-height: 1.5; padding: 0px;&quot;&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;post_footer_contents&quot; style=&quot;background-color: #a9c6d9; font-family: dotum; font-size: 12px; min-height: 16px; position: relative;&quot;&gt;
&lt;div class=&quot;autosourcing-stub-extra&quot; style=&quot;opacity: 1; position: absolute; zoom: 1;&quot;&gt;
&lt;div style=&quot;font-family: Dotum; margin-bottom: 7px; margin-top: 11px; padding: 0px;&quot;&gt;
&lt;strong style=&quot;padding: 0px 7px 0px 0px;&quot;&gt;[출처]&lt;/strong&gt;&amp;nbsp;&lt;a href=&quot;https://blog.naver.com/james2021/30073139792&quot; style=&quot;text-decoration-line: none;&quot; target=&quot;_blank&quot;&gt;알아두면 유용한 토탈커맨더 단축키&lt;/a&gt;&lt;span style=&quot;padding: 0px 7px 0px 5px;&quot;&gt;|&lt;/span&gt;&lt;strong style=&quot;padding: 0px 7px 0px 0px;&quot;&gt;작성자&lt;/strong&gt;&amp;nbsp;&lt;a href=&quot;https://blog.naver.com/james2021&quot; style=&quot;text-decoration-line: none;&quot; target=&quot;_blank&quot;&gt;바다&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://bridroid.blogspot.com/feeds/3473320829601313503/comments/default' title='댓글'/><link rel='replies' type='text/html' href='http://bridroid.blogspot.com/2018/01/blog-post.html#comment-form' title='0개의 덧글'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/905901812770512183/posts/default/3473320829601313503'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/905901812770512183/posts/default/3473320829601313503'/><link rel='alternate' type='text/html' href='http://bridroid.blogspot.com/2018/01/blog-post.html' title='토탈커맨더_기능'/><author><name>brith1225</name><uri>http://www.blogger.com/profile/15293023387175369557</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-905901812770512183.post-8522669278884515346</id><published>2018-01-05T00:32:00.001-08:00</published><updated>2018-01-05T00:33:06.624-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="jeus"/><category scheme="http://www.blogger.com/atom/ns#" term="jeus7"/><category scheme="http://www.blogger.com/atom/ns#" term="jeus7 재기동"/><category scheme="http://www.blogger.com/atom/ns#" term="jeus재기동"/><category scheme="http://www.blogger.com/atom/ns#" term="tomcat"/><category scheme="http://www.blogger.com/atom/ns#" term="was"/><title type='text'>was jeus7 </title><content type='html'>&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; style=&quot;background-color: white; color: #111111; font-family: &amp;quot;맑은 고딕&amp;quot;, &amp;quot;Malgun Gothic&amp;quot;, 돋움, dotum, sans-serif; font-size: 14px; width: 100%px; word-break: break-all; word-wrap: break-word;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;line-height: 1.5; margin: 0px; padding: 0px; word-break: break-all; word-wrap: break-word;&quot;&gt;&lt;div style=&quot;font-family: &amp;quot;Apple SD Gothic Neo&amp;quot;, &amp;quot;Malgun Gothic&amp;quot;, &amp;quot;맑은 고딕&amp;quot;, sans-serif; font-size: 10pt; line-height: 1.5; margin: 0px; padding: 0px; word-break: break-all; word-wrap: break-word;&quot;&gt;
&lt;div style=&quot;padding: 0px; word-break: break-all; word-wrap: break-word;&quot;&gt;
&lt;span style=&quot;font-size: 10pt; word-break: break-all; word-wrap: break-word;&quot;&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; display: inline; float: none; font-family: &amp;quot;font-size:14.6667px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: normal; letter-spacing: normal; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-break: break-all; word-spacing: 0px; word-wrap: break-word;&quot;&gt;&lt;br style=&quot;word-break: break-all; word-wrap: break-word;&quot; /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0px; word-break: break-all; word-wrap: break-word;&quot;&gt;
&lt;span style=&quot;font-size: 10pt; word-break: break-all; word-wrap: break-word;&quot;&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; display: inline; float: none; font-family: &amp;quot;font-size:14.6667px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: normal; letter-spacing: normal; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-break: break-all; word-spacing: 0px; word-wrap: break-word;&quot;&gt;&lt;br style=&quot;word-break: break-all; word-wrap: break-word;&quot; /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0px; word-break: break-all; word-wrap: break-word;&quot;&gt;
&lt;span style=&quot;font-size: 10pt; word-break: break-all; word-wrap: break-word;&quot;&gt;JEUS 관리자 WEB :&amp;nbsp;&lt;/span&gt;&lt;u style=&quot;font-size: 10pt; word-break: break-all; word-wrap: break-word;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: &amp;quot;맑은 고딕&amp;quot;; font-size: 11pt; letter-spacing: 0pt; word-break: break-all; word-wrap: break-word;&quot;&gt;&lt;a href=&quot;http://192.168.2.20:9736/webadmin/login&quot; rel=&quot;noopener noreferrer&quot; style=&quot;text-decoration-line: none; word-break: break-all; word-wrap: break-word;&quot; target=&quot;_blank&quot;&gt;&lt;/a&gt;&lt;a class=&quot;tx-link&quot; href=&quot;http://192.168.2.20:9736/webadmin/login&quot; rel=&quot;noopener noreferrer&quot; style=&quot;text-decoration-line: none; word-break: break-all; word-wrap: break-word;&quot; target=&quot;_blank&quot;&gt;http://192.168.2.20:9736/webadmin/login&lt;/a&gt;&lt;/span&gt;&lt;/u&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0px; word-break: break-all; word-wrap: break-word;&quot;&gt;
&lt;br style=&quot;word-break: break-all; word-wrap: break-word;&quot; /&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0px; word-break: break-all; word-wrap: break-word;&quot;&gt;
&lt;br style=&quot;word-break: break-all; word-wrap: break-word;&quot; /&gt;&lt;/div&gt;
&lt;div style=&quot;padding: 0px; word-break: break-all; word-wrap: break-word;&quot;&gt;
xshell 에서 콘솔창 로그인&lt;/div&gt;
&lt;div style=&quot;line-height: 13.3333px; padding: 0px; word-break: break-all; word-wrap: break-word;&quot;&gt;
&lt;/div&gt;
&lt;div style=&quot;line-height: 13.3333px; padding: 0px; word-break: break-all; word-wrap: break-word;&quot;&gt;
&lt;/div&gt;
&lt;div style=&quot;line-height: 13.3333px; padding: 0px; word-break: break-all; word-wrap: break-word;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;맑은 고딕&amp;quot;; font-size: 11pt; letter-spacing: 0pt; word-break: break-all; word-wrap: break-word;&quot;&gt;jues/&amp;gt;jeusadmin -u Jeustmax -p xxx&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 13.3333px; padding: 0px; word-break: break-all; word-wrap: break-word;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;맑은 고딕&amp;quot;; font-size: 11pt; letter-spacing: 0pt; word-break: break-all; word-wrap: break-word;&quot;&gt;&lt;br style=&quot;word-break: break-all; word-wrap: break-word;&quot; /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 13.3333px; padding: 0px; word-break: break-all; word-wrap: break-word;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;맑은 고딕&amp;quot;; font-size: 11pt; letter-spacing: 0pt; word-break: break-all; word-wrap: break-word;&quot;&gt;&lt;br style=&quot;word-break: break-all; word-wrap: break-word;&quot; /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 13.3333px; padding: 0px; word-break: break-all; word-wrap: break-word;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;맑은 고딕&amp;quot;; font-size: 11pt; letter-spacing: 0pt; word-break: break-all; word-wrap: break-word;&quot;&gt;&lt;br style=&quot;word-break: break-all; word-wrap: break-word;&quot; /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 13.3333px; padding: 0px; word-break: break-all; word-wrap: break-word;&quot;&gt;
&lt;span style=&quot;font-family: 맑은 고딕; word-break: break-all; word-wrap: break-word;&quot;&gt;&lt;span style=&quot;font-size: 14.6667px; word-break: break-all; word-wrap: break-word;&quot;&gt;ms list&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 13.3333px; padding: 0px; word-break: break-all; word-wrap: break-word;&quot;&gt;
&lt;/div&gt;
&lt;div style=&quot;line-height: 13.3333px; padding: 0px; word-break: break-all; word-wrap: break-word;&quot;&gt;
&lt;/div&gt;
&lt;div style=&quot;line-height: 13.3333px; padding: 0px; word-break: break-all; word-wrap: break-word;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;맑은 고딕&amp;quot;; font-size: 11pt; letter-spacing: 0pt; word-break: break-all; word-wrap: break-word;&quot;&gt;[DAS]jeus_domain.adminServer/&amp;gt;si&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 13.3333px; padding: 0px; word-break: break-all; word-wrap: break-word;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;맑은 고딕&amp;quot;; font-size: 11pt; letter-spacing: 0pt; word-break: break-all; word-wrap: break-word;&quot;&gt;&lt;br style=&quot;word-break: break-all; word-wrap: break-word;&quot; /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 13.3333px; padding: 0px; word-break: break-all; word-wrap: break-word;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;맑은 고딕&amp;quot;; font-size: 11pt; letter-spacing: 0pt; word-break: break-all; word-wrap: break-word;&quot;&gt;&lt;br style=&quot;word-break: break-all; word-wrap: break-word;&quot; /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 13.3333px; padding: 0px; word-break: break-all; word-wrap: break-word;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;맑은 고딕&amp;quot;; font-size: 11pt; letter-spacing: 0pt; word-break: break-all; word-wrap: break-word;&quot;&gt;ms stop&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 13.3333px; padding: 0px; word-break: break-all; word-wrap: break-word;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;맑은 고딕&amp;quot;; font-size: 11pt; letter-spacing: 0pt; word-break: break-all; word-wrap: break-word;&quot;&gt;[DAS]jeus_domain.adminServer/&amp;gt;stop-server server1&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 13.3333px; padding: 0px; word-break: break-all; word-wrap: break-word;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;맑은 고딕&amp;quot;; font-size: 11pt; letter-spacing: 0pt; word-break: break-all; word-wrap: break-word;&quot;&gt;&lt;br style=&quot;word-break: break-all; word-wrap: break-word;&quot; /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 13.3333px; padding: 0px; word-break: break-all; word-wrap: break-word;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;맑은 고딕&amp;quot;; font-size: 11pt; letter-spacing: 0pt; word-break: break-all; word-wrap: break-word;&quot;&gt;ms start&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 13.3333px; padding: 0px; word-break: break-all; word-wrap: break-word;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &amp;quot;맑은 고딕&amp;quot;; font-size: 11pt; letter-spacing: 0pt; word-break: break-all; word-wrap: break-word;&quot;&gt;[DAS]jeus_domain.adminServer/&amp;gt;start-server server1&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
</content><link rel='replies' type='application/atom+xml' href='http://bridroid.blogspot.com/feeds/8522669278884515346/comments/default' title='댓글'/><link rel='replies' type='text/html' href='http://bridroid.blogspot.com/2018/01/was-jeus7.html#comment-form' title='0개의 덧글'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/905901812770512183/posts/default/8522669278884515346'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/905901812770512183/posts/default/8522669278884515346'/><link rel='alternate' type='text/html' href='http://bridroid.blogspot.com/2018/01/was-jeus7.html' title='was jeus7 '/><author><name>brith1225</name><uri>http://www.blogger.com/profile/15293023387175369557</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-905901812770512183.post-1963671168749317952</id><published>2017-04-12T18:07:00.003-07:00</published><updated>2017-04-12T18:08:17.558-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="wcfg"/><category scheme="http://www.blogger.com/atom/ns#" term="webtob"/><category scheme="http://www.blogger.com/atom/ns#" term="wsadmin"/><category scheme="http://www.blogger.com/atom/ns#" term="wsboot"/><category scheme="http://www.blogger.com/atom/ns#" term="wsdown"/><category scheme="http://www.blogger.com/atom/ns#" term="웹투비"/><title type='text'>webtob</title><content type='html'>$wsdown&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
$wcfg&lt;br /&gt;
$wscfl -i http.m&lt;br /&gt;
$wsboot&lt;br /&gt;
&lt;br /&gt;
wsadmin -v&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
$wsadmin&lt;br /&gt;
#si&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
$wsadmin&lt;br /&gt;
#si&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
WEB:/HOME1/tmax&amp;gt; wsadmin&lt;br /&gt;
--- Welcome to WebtoB Admin (Type &quot;quit&quot; to leave) ---&lt;br /&gt;
&lt;br /&gt;
$$1 WEB (wsadm) [2017/04/10:21:27:35]: si&lt;br /&gt;
&lt;br /&gt;
장애 : NRDY&lt;br /&gt;
&lt;br /&gt;
------------------------------------------------------------------------------------------&lt;br /&gt;
&amp;nbsp;hth &amp;nbsp; svrname (svri) &amp;nbsp; status &amp;nbsp; &amp;nbsp; &amp;nbsp;reqs &amp;nbsp; &amp;nbsp; count cqcnt &amp;nbsp; &amp;nbsp;aqcnt qpcnt emcnt rscnt rbcnt&lt;br /&gt;
------------------------------------------------------------------------------------------&lt;br /&gt;
&amp;nbsp; &amp;nbsp;0 &amp;nbsp;html &amp;nbsp; &amp;nbsp; &amp;nbsp; ( &amp;nbsp;0) &amp;nbsp; RDY &amp;nbsp; &amp;nbsp;48061630 &amp;nbsp;48061617 &amp;nbsp; &amp;nbsp; 0 &amp;nbsp; &amp;nbsp; 1600 &amp;nbsp; &amp;nbsp; 0 &amp;nbsp; &amp;nbsp; 0 &amp;nbsp; &amp;nbsp; 0 &amp;nbsp; &amp;nbsp; 0&lt;br /&gt;
&amp;nbsp; &amp;nbsp;0 &amp;nbsp;MyGroup1 &amp;nbsp; ( &amp;nbsp;1) &amp;nbsp; RDY &amp;nbsp; &amp;nbsp; 6249975 &amp;nbsp; 6248700 &amp;nbsp; &amp;nbsp; 0 &amp;nbsp; &amp;nbsp;22762 &amp;nbsp; &amp;nbsp; 0 &amp;nbsp; &amp;nbsp; 0 &amp;nbsp; &amp;nbsp; 0 &amp;nbsp; &amp;nbsp; 0&lt;br /&gt;
&amp;nbsp; &amp;nbsp;0 &amp;nbsp;ssl_html &amp;nbsp; ( &amp;nbsp;2) &amp;nbsp; RDY &amp;nbsp; &amp;nbsp;13972155 &amp;nbsp;13972154 &amp;nbsp; &amp;nbsp; 0 &amp;nbsp; &amp;nbsp; &amp;nbsp;468 &amp;nbsp; &amp;nbsp; 0 &amp;nbsp; &amp;nbsp; 0 &amp;nbsp; &amp;nbsp; 0 &amp;nbsp; &amp;nbsp; 0&lt;br /&gt;
&amp;nbsp; &amp;nbsp;0 &amp;nbsp;sslGroup &amp;nbsp; ( &amp;nbsp;3) &amp;nbsp; RDY &amp;nbsp; &amp;nbsp; 3195538 &amp;nbsp; 3195418 &amp;nbsp; &amp;nbsp; 0 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0 &amp;nbsp; &amp;nbsp; 0 &amp;nbsp; &amp;nbsp; 0 &amp;nbsp; &amp;nbsp; 0 &amp;nbsp; &amp;nbsp; 0&lt;br /&gt;
&amp;nbsp; &amp;nbsp;0 &amp;nbsp;mobileGroup ( &amp;nbsp;4) &amp;nbsp; RDY &amp;nbsp; &amp;nbsp; 1442231 &amp;nbsp; 1437903 &amp;nbsp; &amp;nbsp; 0 &amp;nbsp; &amp;nbsp;47322 &amp;nbsp; &amp;nbsp; 0 &amp;nbsp; &amp;nbsp; 0 &amp;nbsp; &amp;nbsp; 0 &amp;nbsp; &amp;nbsp; 0&lt;br /&gt;
&amp;nbsp; &amp;nbsp;0 &amp;nbsp;esvGroup &amp;nbsp; ( &amp;nbsp;5) &amp;nbsp; RDY &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0 &amp;nbsp; &amp;nbsp; 0 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0 &amp;nbsp; &amp;nbsp; 0 &amp;nbsp; &amp;nbsp; 0 &amp;nbsp; &amp;nbsp; 0 &amp;nbsp; &amp;nbsp; 0&lt;br /&gt;
&amp;nbsp; &amp;nbsp;0 &amp;nbsp;kncapGroup ( &amp;nbsp;6) &amp;nbsp; RDY &amp;nbsp; &amp;nbsp; 1901708 &amp;nbsp; 1901701 &amp;nbsp; &amp;nbsp; 0 &amp;nbsp; 187264 &amp;nbsp; &amp;nbsp; 0 &amp;nbsp; &amp;nbsp; 0 &amp;nbsp; &amp;nbsp; 0 &amp;nbsp; &amp;nbsp; 0&lt;br /&gt;
&amp;nbsp; &amp;nbsp;0 &amp;nbsp;carGroup &amp;nbsp; ( &amp;nbsp;7) &amp;nbsp; RDY &amp;nbsp; &amp;nbsp;92571885 &amp;nbsp;92571882 &amp;nbsp; &amp;nbsp; 0 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0 &amp;nbsp; &amp;nbsp; 0 &amp;nbsp; &amp;nbsp; 0 &amp;nbsp; &amp;nbsp; 0 &amp;nbsp; &amp;nbsp; 0&lt;br /&gt;
&amp;nbsp; &amp;nbsp;0 &amp;nbsp;ssl_carGroup ( &amp;nbsp;8) &amp;nbsp; RDY &amp;nbsp; &amp;nbsp; &amp;nbsp; 17727 &amp;nbsp; &amp;nbsp; 17726 &amp;nbsp; &amp;nbsp; 0 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0 &amp;nbsp; &amp;nbsp; 0 &amp;nbsp; &amp;nbsp; 0 &amp;nbsp; &amp;nbsp; 0 &amp;nbsp; &amp;nbsp; 0</content><link rel='replies' type='application/atom+xml' href='http://bridroid.blogspot.com/feeds/1963671168749317952/comments/default' title='댓글'/><link rel='replies' type='text/html' href='http://bridroid.blogspot.com/2017/04/webtob.html#comment-form' title='0개의 덧글'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/905901812770512183/posts/default/1963671168749317952'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/905901812770512183/posts/default/1963671168749317952'/><link rel='alternate' type='text/html' href='http://bridroid.blogspot.com/2017/04/webtob.html' title='webtob'/><author><name>brith1225</name><uri>http://www.blogger.com/profile/15293023387175369557</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-905901812770512183.post-68222240915253629</id><published>2017-04-12T00:31:00.003-07:00</published><updated>2017-04-12T00:31:50.196-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="downcon"/><category scheme="http://www.blogger.com/atom/ns#" term="ja"/><category scheme="http://www.blogger.com/atom/ns#" term="jeus"/><category scheme="http://www.blogger.com/atom/ns#" term="startcon"/><title type='text'>jeus</title><content type='html'>ja&lt;br /&gt;
conslist&lt;br /&gt;
applist&lt;br /&gt;
&lt;br /&gt;
downcon container1&lt;br /&gt;
startcon container1</content><link rel='replies' type='application/atom+xml' href='http://bridroid.blogspot.com/feeds/68222240915253629/comments/default' title='댓글'/><link rel='replies' type='text/html' href='http://bridroid.blogspot.com/2017/04/jeus.html#comment-form' title='0개의 덧글'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/905901812770512183/posts/default/68222240915253629'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/905901812770512183/posts/default/68222240915253629'/><link rel='alternate' type='text/html' href='http://bridroid.blogspot.com/2017/04/jeus.html' title='jeus'/><author><name>brith1225</name><uri>http://www.blogger.com/profile/15293023387175369557</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-905901812770512183.post-3092470119980711384</id><published>2017-04-12T00:31:00.000-07:00</published><updated>2017-04-12T00:31:04.431-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="session"/><category scheme="http://www.blogger.com/atom/ns#" term="로그인"/><category scheme="http://www.blogger.com/atom/ns#" term="중복로그인"/><category scheme="http://www.blogger.com/atom/ns#" term="중복로그인방지"/><title type='text'>중복로그인 방지</title><content type='html'>&lt;br /&gt;
import java.util.ArrayList;&lt;br /&gt;
import java.util.Collections;&lt;br /&gt;
import java.util.Enumeration;&lt;br /&gt;
import java.util.Hashtable;&lt;br /&gt;
import java.util.List;&lt;br /&gt;
&lt;br /&gt;
import javax.servlet.http.Cookie;&lt;br /&gt;
import javax.servlet.http.HttpServletRequest;&lt;br /&gt;
import javax.servlet.http.HttpServletResponse;&lt;br /&gt;
import javax.servlet.http.HttpSession;&lt;br /&gt;
&lt;br /&gt;
public class SessionCheck &amp;nbsp;{&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;private static SessionCheck sessionManager ;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;//private static Thread sessionThread;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Hashtable&amp;lt;String, SessionUser&amp;gt; accessUserList = new Hashtable&amp;lt;String, SessionUser&amp;gt;();&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;//private boolean isRunning = false;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;private SessionCheck() {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;public static SessionCheck getInstance() {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;if(sessionManager == null) {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;sessionManager = new SessionCheck();&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;/*if(sessionThread == null){&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;sessionThread = new Thread( sessionManager);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;sessionThread.start();&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;*/&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;return sessionManager;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;/*&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;public void run() {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;System.out.println(&quot;Session Check start.......&quot;);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;try {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;while(true) {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;System.out.println(&quot;Session Check Begin....&quot;);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;sessionCheckProc();&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;isRunning= true;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;System.out.println(&quot;Session Check End....&quot;);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;Thread.sleep(20000);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;} catch (Exception e) {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;} finally {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;System.out.println(&quot;Session Check Terminated....&quot;);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;isRunning = false;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}*/&lt;br /&gt;
/*&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;private void sessionCheckProc() {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;// TODO Auto-generated method stub&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;// 30분 초과 접속시 모두로그아웃 시킴&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;Enumeration e = accessUserList.keys();&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;while(e.hasMoreElements()) {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;String uid = (String)e.nextElement();&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;SessionUser user = (SessionUser)accessUserList.get(uid);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;System.out.println( System.currentTimeMillis() - user.getLastAccessMiles() );&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;if( &amp;nbsp;System.currentTimeMillis() - user.getLastAccessMiles() &amp;gt; 30000) {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;// logout target &lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;accessUserList.remove(uid);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;System.out.println(&quot;Thread Remove user :&quot;+uid);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;*/&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;/**&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; *로그인을 시도 하였을 때 기존 로그인 정보를 삭제한다.&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; *새로 로그인 된 정보를 입력하여 처리한다.&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; * @param uid&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; */&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;public void doLogin(String uid, String uname, String ipaddr, HttpSession session) {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;SessionUser user = accessUserList.get(uid);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;// 다른곳에서로그인 되어 있거나 , 세션이 끊어지지 않았다면 세션을 종료 시킨다.&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;if(user != null) { &lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;try{&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;user.getSession().invalidate();&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;}catch(Exception e){&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;System.out.println(&quot;Remove user :&quot;+uid);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;accessUserList.remove(uid);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;SessionUser newUser = new SessionUser();&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;newUser.setLastAccessMiles(System.currentTimeMillis());&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;newUser.setIpAddress(ipaddr);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;newUser.setUserNm(uname);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;newUser.setUserId(uid);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;newUser.setSession(session);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;System.out.println(&quot;Login comp ==&amp;gt;&quot;+uid);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;accessUserList.put(uid, newUser);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;public boolean isLogin(String uid, String ip, String SESSION_ID) {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;SessionUser user = accessUserList.get(uid);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;if(user == null)&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;return false;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;// 세션아이디 및 접속 아이피가 동일하여야 함.&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;if(user.getIpAddress().equals(ip) &amp;amp;&amp;amp; user.getSessionId().equals(SESSION_ID)) {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;// 최종 접속시간을 변경하여 준다.&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;user.setLastAccessMiles(System.currentTimeMillis());&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;return true;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;return false;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;public static String getJSessionID(HttpServletRequest request) {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;Cookie[] cookies = request.getCookies();&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;try {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;for(int i=0; i&amp;lt;cookies.length; i++) {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;String cname = cookies[i].getName();&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;String value = cookies[i].getValue();&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;if(cname.toUpperCase().equals(&quot;JSESSIONID&quot;))&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;return cookies[i].getValue();&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;} catch (Exception e) { &lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;return null;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;public List&amp;lt;SessionUser&amp;gt; getLoginUsers() {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;List&amp;lt;SessionUser&amp;gt; users = new ArrayList&amp;lt;SessionUser&amp;gt;();&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;Enumeration e = accessUserList.keys();&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;while(e.hasMoreElements()) {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;String uid = (String)e.nextElement();&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;SessionUser user = accessUserList.get(uid);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;System.out.println(user.getUserId()+&quot; &quot;+user.getLastAccessMiles());&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;users.add(user);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;Collections.sort(users);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;return users;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;br /&gt;
}&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://bridroid.blogspot.com/feeds/3092470119980711384/comments/default' title='댓글'/><link rel='replies' type='text/html' href='http://bridroid.blogspot.com/2017/04/blog-post.html#comment-form' title='0개의 덧글'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/905901812770512183/posts/default/3092470119980711384'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/905901812770512183/posts/default/3092470119980711384'/><link rel='alternate' type='text/html' href='http://bridroid.blogspot.com/2017/04/blog-post.html' title='중복로그인 방지'/><author><name>brith1225</name><uri>http://www.blogger.com/profile/15293023387175369557</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-905901812770512183.post-793492499597918967</id><published>2015-07-01T21:25:00.003-07:00</published><updated>2015-07-01T21:25:31.349-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Facebook API"/><category scheme="http://www.blogger.com/atom/ns#" term="Facebook API 공유"/><category scheme="http://www.blogger.com/atom/ns#" term="Facebook API 공유하기"/><category scheme="http://www.blogger.com/atom/ns#" term="페이스북 api"/><category scheme="http://www.blogger.com/atom/ns#" term="페이스북 공유"/><title type='text'>Facebook API 공유하기</title><content type='html'>function share_facebook(){&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;var shareUrl = &quot;https://www.facebook.com/sharer/sharer.php?u=&quot;+encodeURIComponent(공유할url);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;var popOption = &quot;width=370, height=360, resizable=no, scrollbars=no, status=no;&quot;;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp;var wp = window.open(shareUrl, &#39;facebook&#39;, popOption);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp;if ( wp ) {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp;wp.focus();&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp;}&lt;br /&gt;
}</content><link rel='replies' type='application/atom+xml' href='http://bridroid.blogspot.com/feeds/793492499597918967/comments/default' title='댓글'/><link rel='replies' type='text/html' href='http://bridroid.blogspot.com/2015/07/facebook-api.html#comment-form' title='0개의 덧글'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/905901812770512183/posts/default/793492499597918967'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/905901812770512183/posts/default/793492499597918967'/><link rel='alternate' type='text/html' href='http://bridroid.blogspot.com/2015/07/facebook-api.html' title='Facebook API 공유하기'/><author><name>brith1225</name><uri>http://www.blogger.com/profile/15293023387175369557</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-905901812770512183.post-8856007822236071555</id><published>2015-07-01T21:21:00.002-07:00</published><updated>2015-07-01T21:21:50.932-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="kakaostory api"/><category scheme="http://www.blogger.com/atom/ns#" term="카카오스토리 api"/><category scheme="http://www.blogger.com/atom/ns#" term="카카오스토리 api 공유"/><category scheme="http://www.blogger.com/atom/ns#" term="카카오스토리 api 공유하기"/><title type='text'>카카오스토리 api 공유하기</title><content type='html'>&amp;lt;script language=&quot;javascript&quot; src=&quot;/front/js/login/kakao.min.js&quot;&amp;gt;&amp;lt;/script&amp;gt;// 카카오 개발자 페이지에서 js 파일 다운&lt;br /&gt;
&lt;br /&gt;
function share_kakaostory(){&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Kakao.init(&#39;23423&#39;);// 카카오 개발자 등록후 발급받은 키&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Kakao.Story.share({&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;url: 공유할 url&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;});&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Kakao.cleanup();&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
}</content><link rel='replies' type='application/atom+xml' href='http://bridroid.blogspot.com/feeds/8856007822236071555/comments/default' title='댓글'/><link rel='replies' type='text/html' href='http://bridroid.blogspot.com/2015/07/api_61.html#comment-form' title='0개의 덧글'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/905901812770512183/posts/default/8856007822236071555'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/905901812770512183/posts/default/8856007822236071555'/><link rel='alternate' type='text/html' href='http://bridroid.blogspot.com/2015/07/api_61.html' title='카카오스토리 api 공유하기'/><author><name>brith1225</name><uri>http://www.blogger.com/profile/15293023387175369557</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-905901812770512183.post-8735067115145381541</id><published>2015-07-01T21:20:00.000-07:00</published><updated>2015-07-01T21:20:14.294-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="kakao api"/><category scheme="http://www.blogger.com/atom/ns#" term="카카오톡 api"/><category scheme="http://www.blogger.com/atom/ns#" term="카카오톡 api 공유하기"/><category scheme="http://www.blogger.com/atom/ns#" term="카카오톡 공유"/><title type='text'>카카오톡 api 공유하기</title><content type='html'>&amp;lt;script language=&quot;javascript&quot; src=&quot;/js/kakao.min.js&quot;&amp;gt;&amp;lt;/script&amp;gt; //&amp;lt;--카카오 개발자 페이지에서 &amp;nbsp;js 파일 다운로드&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
function share_kakaotalk(){&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Kakao.init(&#39;324234&#39;); &amp;nbsp;//카카오 개발자등록 후 발급받은 키&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Kakao.Link.sendTalkLink({&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;label: 공유할 내용&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; });&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Kakao.cleanup();&lt;br /&gt;
}</content><link rel='replies' type='application/atom+xml' href='http://bridroid.blogspot.com/feeds/8735067115145381541/comments/default' title='댓글'/><link rel='replies' type='text/html' href='http://bridroid.blogspot.com/2015/07/api_99.html#comment-form' title='0개의 덧글'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/905901812770512183/posts/default/8735067115145381541'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/905901812770512183/posts/default/8735067115145381541'/><link rel='alternate' type='text/html' href='http://bridroid.blogspot.com/2015/07/api_99.html' title='카카오톡 api 공유하기'/><author><name>brith1225</name><uri>http://www.blogger.com/profile/15293023387175369557</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-905901812770512183.post-1163403617187738539</id><published>2015-07-01T21:17:00.000-07:00</published><updated>2015-07-01T21:17:22.823-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="band api"/><category scheme="http://www.blogger.com/atom/ns#" term="band 공유하기"/><category scheme="http://www.blogger.com/atom/ns#" term="네이버 밴드 api"/><category scheme="http://www.blogger.com/atom/ns#" term="네이버 밴드 api 공유하기"/><category scheme="http://www.blogger.com/atom/ns#" term="밴드 api"/><title type='text'>네이버 밴드 api 공유하기</title><content type='html'>function share_band(){&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;var shareUrl = &quot;http://www.band.us/plugin/share?body=&quot;+encodeURIComponent(공유할내용)+&quot;&amp;amp;route=&quot;+encodeURIComponent(공유할 ull);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;window.open(shareUrl, &quot;share_band&quot;, &quot;width=410, height=540, resizable=no&quot;);&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
}</content><link rel='replies' type='application/atom+xml' href='http://bridroid.blogspot.com/feeds/1163403617187738539/comments/default' title='댓글'/><link rel='replies' type='text/html' href='http://bridroid.blogspot.com/2015/07/api_1.html#comment-form' title='0개의 덧글'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/905901812770512183/posts/default/1163403617187738539'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/905901812770512183/posts/default/1163403617187738539'/><link rel='alternate' type='text/html' href='http://bridroid.blogspot.com/2015/07/api_1.html' title='네이버 밴드 api 공유하기'/><author><name>brith1225</name><uri>http://www.blogger.com/profile/15293023387175369557</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-905901812770512183.post-3356009070500227243</id><published>2014-07-17T01:46:00.001-07:00</published><updated>2014-07-17T01:46:21.663-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="java"/><title type='text'>Java - Multithreading Programming Tutorial</title><content type='html'>&lt;div style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 12px; margin-bottom: 1em; margin-top: 0.8em; padding: 0px; text-align: justify;&quot;&gt;Java is a&lt;i style=&quot;margin: 0px; padding: 0px;&quot;&gt;multithreaded programming language&lt;/i&gt;&amp;nbsp;which means we can develop multithreaded program using Java. A multithreaded program contains two or more parts that can run concurrently and each part can handle different task at the same time making optimal use of the available resources specially when your computer has multiple CPUs.&lt;/div&gt;&lt;div style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 12px; margin-bottom: 1em; margin-top: 0.8em; padding: 0px; text-align: justify;&quot;&gt;By definition multitasking is when multiple processes share common processing resources such as a CPU. Multithreading extends the idea of multitasking into applications where you can subdivide specific operations within a single application into individual threads. Each of the threads can run in parallel. The OS divides processing time not only among different applications, but also among each thread within an application.&lt;/div&gt;&lt;div style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 12px; margin-bottom: 1em; margin-top: 0.8em; padding: 0px; text-align: justify;&quot;&gt;Multithreading enables you to write in a way where multiple activities can proceed concurrently in the same program.&lt;/div&gt;&lt;h2 style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 1.6em; font-weight: normal; line-height: 1.5em; margin: 0.2em 0.2em 0.2em 0px; padding: 0px; text-shadow: rgb(204, 204, 204) 1px 1px 2px;&quot;&gt;Life Cycle of a Thread:&lt;/h2&gt;&lt;div style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 12px; margin-bottom: 1em; margin-top: 0.8em; padding: 0px; text-align: justify;&quot;&gt;A thread goes through various stages in its life cycle. For example, a thread is born, started, runs, and then dies. Following diagram shows complete life cycle of a thread.&lt;/div&gt;&lt;center style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 12px;&quot;&gt;&lt;img alt=&quot;Java Thread&quot; src=&quot;http://www.tutorialspoint.com/images/java_thread.jpg&quot; style=&quot;border: 0px; display: block; height: auto; margin: auto; max-width: 560px; padding: 0px 0px 10px;&quot; /&gt;&lt;/center&gt;&lt;div style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 12px; margin-bottom: 1em; margin-top: 0.8em; padding: 0px; text-align: justify;&quot;&gt;Above-mentioned stages are explained here:&lt;/div&gt;&lt;ul class=&quot;list&quot; style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 12px; list-style: none; margin: 0px; padding: 0px 0px 0px 15px;&quot;&gt;&lt;li style=&quot;background: url(http://www.tutorialspoint.com/images/icon-bullet.png) 0px 0px no-repeat; margin: 0px; padding: 0px 0px 0px 19px;&quot;&gt;&lt;div style=&quot;margin-bottom: 1em; margin-top: 0.8em; padding: 0px; text-align: justify;&quot;&gt;&lt;b style=&quot;margin: 0px; padding: 0px;&quot;&gt;New:&lt;/b&gt;&amp;nbsp;A new thread begins its life cycle in the new state. It remains in this state until the program starts the thread. It is also referred to as a born thread.&lt;/div&gt;&lt;/li&gt;
&lt;li style=&quot;background: url(http://www.tutorialspoint.com/images/icon-bullet.png) 0px 0px no-repeat; margin: 0px; padding: 0px 0px 0px 19px;&quot;&gt;&lt;div style=&quot;margin-bottom: 1em; margin-top: 0.8em; padding: 0px; text-align: justify;&quot;&gt;&lt;b style=&quot;margin: 0px; padding: 0px;&quot;&gt;Runnable:&lt;/b&gt;&amp;nbsp;After a newly born thread is started, the thread becomes runnable. A thread in this state is considered to be executing its task.&lt;/div&gt;&lt;/li&gt;
&lt;li style=&quot;background: url(http://www.tutorialspoint.com/images/icon-bullet.png) 0px 0px no-repeat; margin: 0px; padding: 0px 0px 0px 19px;&quot;&gt;&lt;div style=&quot;margin-bottom: 1em; margin-top: 0.8em; padding: 0px; text-align: justify;&quot;&gt;&lt;b style=&quot;margin: 0px; padding: 0px;&quot;&gt;Waiting:&lt;/b&gt;&amp;nbsp;Sometimes, a thread transitions to the waiting state while the thread waits for another thread to perform a task.A thread transitions back to the runnable state only when another thread signals the waiting thread to continue executing.&lt;/div&gt;&lt;/li&gt;
&lt;li style=&quot;background: url(http://www.tutorialspoint.com/images/icon-bullet.png) 0px 0px no-repeat; margin: 0px; padding: 0px 0px 0px 19px;&quot;&gt;&lt;div style=&quot;margin-bottom: 1em; margin-top: 0.8em; padding: 0px; text-align: justify;&quot;&gt;&lt;b style=&quot;margin: 0px; padding: 0px;&quot;&gt;Timed waiting:&lt;/b&gt;&amp;nbsp;A runnable thread can enter the timed waiting state for a specified interval of time. A thread in this state transitions back to the runnable state when that time interval expires or when the event it is waiting for occurs.&lt;/div&gt;&lt;/li&gt;
&lt;li style=&quot;background: url(http://www.tutorialspoint.com/images/icon-bullet.png) 0px 0px no-repeat; margin: 0px; padding: 0px 0px 0px 19px;&quot;&gt;&lt;div style=&quot;margin-bottom: 1em; margin-top: 0.8em; padding: 0px; text-align: justify;&quot;&gt;&lt;b style=&quot;margin: 0px; padding: 0px;&quot;&gt;Terminated:&amp;nbsp;&lt;/b&gt;A runnable thread enters the terminated state when it completes its task or otherwise terminates.&lt;/div&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;h2 style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 1.6em; font-weight: normal; line-height: 1.5em; margin: 0.2em 0.2em 0.2em 0px; padding: 0px; text-shadow: rgb(204, 204, 204) 1px 1px 2px;&quot;&gt;Thread Priorities:&lt;/h2&gt;&lt;div style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 12px; margin-bottom: 1em; margin-top: 0.8em; padding: 0px; text-align: justify;&quot;&gt;Every Java thread has a priority that helps the operating system determine the order in which threads are scheduled.&lt;/div&gt;&lt;div style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 12px; margin-bottom: 1em; margin-top: 0.8em; padding: 0px; text-align: justify;&quot;&gt;Java thread priorities are in the range between MIN_PRIORITY (a constant of 1) and MAX_PRIORITY (a constant of 10). By default, every thread is given priority NORM_PRIORITY (a constant of 5).&lt;/div&gt;&lt;div style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 12px; margin-bottom: 1em; margin-top: 0.8em; padding: 0px; text-align: justify;&quot;&gt;Threads with higher priority are more important to a program and should be allocated processor time before lower-priority threads. However, thread priorities cannot guarantee the order in which threads execute and very much platform dependentant.&lt;/div&gt;&lt;h2 style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 1.6em; font-weight: normal; line-height: 1.5em; margin: 0.2em 0.2em 0.2em 0px; padding: 0px; text-shadow: rgb(204, 204, 204) 1px 1px 2px;&quot;&gt;Create Thread by Implementing Runnable Interface:&lt;/h2&gt;&lt;div style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 12px; margin-bottom: 1em; margin-top: 0.8em; padding: 0px; text-align: justify;&quot;&gt;If your class is intended to be executed as a thread then you can achieve this by implementing&lt;b style=&quot;margin: 0px; padding: 0px;&quot;&gt;Runnable&lt;/b&gt;&amp;nbsp;interface. You will need to follow three basic steps:&lt;/div&gt;&lt;h3 style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 1.2em; font-weight: normal; line-height: 1.5em; margin: 0.2em 0.2em 0.2em 0px; padding: 0px; text-shadow: rgb(204, 204, 204) 1px 1px 2px; text-transform: uppercase;&quot;&gt;STEP 1:&lt;/h3&gt;&lt;div style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 12px; margin-bottom: 1em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px !important; text-align: justify;&quot;&gt;As a first step you need to implement a run() method provided by&amp;nbsp;&lt;b style=&quot;margin: 0px; padding: 0px;&quot;&gt;Runnable&lt;/b&gt;&amp;nbsp;interface. This method provides entry point for the thread and you will put you complete business logic inside this method. Following is simple syntax of run() method:&lt;/div&gt;&lt;pre class=&quot;prettyprint prettyprinted&quot; style=&quot;background-color: #eeeeee; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; border: 1px solid rgb(214, 214, 214); font-size: 12px; margin-bottom: 10px; overflow: auto; padding: 5px; width: 549.765625px;&quot;&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;public&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;void&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; run&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt;&lt;/pre&gt;&lt;h3 style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 1.2em; font-weight: normal; line-height: 1.5em; margin: 0.2em 0.2em 0.2em 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 10px !important; text-shadow: rgb(204, 204, 204) 1px 1px 2px; text-transform: uppercase;&quot;&gt;STEP 2:&lt;/h3&gt;&lt;div style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 12px; margin-bottom: 1em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px !important; text-align: justify;&quot;&gt;At second step you will instantiate a&amp;nbsp;&lt;b style=&quot;margin: 0px; padding: 0px;&quot;&gt;Thread&lt;/b&gt;&amp;nbsp;object using the following constructor:&lt;/div&gt;&lt;pre class=&quot;prettyprint prettyprinted&quot; style=&quot;background-color: #eeeeee; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; border: 1px solid rgb(214, 214, 214); font-size: 12px; margin-bottom: 10px; overflow: auto; padding: 5px; width: 549.765625px;&quot;&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;Thread&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;Runnable&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; threadObj&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; threadName&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;&lt;/pre&gt;&lt;div style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 12px; margin-bottom: 1em; margin-top: 0.8em; padding: 0px; text-align: justify;&quot;&gt;Where,&amp;nbsp;&lt;i style=&quot;margin: 0px; padding: 0px;&quot;&gt;threadObj&lt;/i&gt;&amp;nbsp;is an instance of a class that implements the&amp;nbsp;&lt;b style=&quot;margin: 0px; padding: 0px;&quot;&gt;Runnable&lt;/b&gt;&amp;nbsp;interface and&amp;nbsp;&lt;b style=&quot;margin: 0px; padding: 0px;&quot;&gt;threadName&lt;/b&gt;&amp;nbsp;is the name given to the new thread.&lt;/div&gt;&lt;h3 style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 1.2em; font-weight: normal; line-height: 1.5em; margin: 0.2em 0.2em 0.2em 0px; padding: 0px; text-shadow: rgb(204, 204, 204) 1px 1px 2px; text-transform: uppercase;&quot;&gt;STEP 3&lt;/h3&gt;&lt;div style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 12px; margin-bottom: 1em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px !important; text-align: justify;&quot;&gt;Once Thread object is created, you can start it by calling&amp;nbsp;&lt;b style=&quot;margin: 0px; padding: 0px;&quot;&gt;start( )&lt;/b&gt;&amp;nbsp;method, which executes a call to run( ) method. Following is simple syntax of start() method:&lt;/div&gt;&lt;pre class=&quot;prettyprint prettyprinted&quot; style=&quot;background-color: #eeeeee; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; border: 1px solid rgb(214, 214, 214); font-size: 12px; margin-bottom: 10px; overflow: auto; padding: 5px; width: 549.765625px;&quot;&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;void&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; start&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;&lt;/pre&gt;&lt;h2 style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 1.6em; font-weight: normal; line-height: 1.5em; margin: 0.2em 0.2em 0.2em 0px; padding: 0px; text-shadow: rgb(204, 204, 204) 1px 1px 2px;&quot;&gt;Example:&lt;/h2&gt;&lt;div style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 12px; margin-bottom: 1em; margin-top: 0.8em; padding: 0px; text-align: justify;&quot;&gt;Here is an example that creates a new thread and starts it running:&lt;/div&gt;&lt;pre class=&quot;prettyprint tryit prettyprinted&quot; style=&quot;background-attachment: initial !important; background-clip: initial !important; background-color: rgb(238, 238, 238) !important; background-image: url(http://www.tutorialspoint.com/images/link.png) !important; background-origin: initial !important; background-position: 100% 0%; background-repeat: no-repeat !important; background-size: initial !important; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; border: 1px solid rgb(214, 214, 214); font-size: 12px; margin-bottom: 10px; overflow: auto; padding: 5px; width: 549.765625px;&quot;&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;RunnableDemo&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;implements&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;Runnable&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
   &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;private&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;Thread&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; t&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
   &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;private&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; threadName&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
   
   &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;RunnableDemo&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; name&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;){&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
       threadName &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; name&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
       &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;System&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;out&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;println&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;color: #008800; margin: 0px; padding: 0px;&quot;&gt;&quot;Creating &quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;  threadName &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
   &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
   &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;public&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;void&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; run&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
      &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;System&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;out&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;println&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;color: #008800; margin: 0px; padding: 0px;&quot;&gt;&quot;Running &quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;  threadName &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
      &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;try&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
         &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;for&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;int&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; i &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666; margin: 0px; padding: 0px;&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; i &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666; margin: 0px; padding: 0px;&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; i&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;--)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
            &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;System&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;out&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;println&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;color: #008800; margin: 0px; padding: 0px;&quot;&gt;&quot;Thread: &quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; threadName &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;color: #008800; margin: 0px; padding: 0px;&quot;&gt;&quot;, &quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; i&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
            &lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;color: #880000; margin: 0px; padding: 0px;&quot;&gt;// Let the thread sleep for a while.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
            &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;Thread&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;sleep&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666; margin: 0px; padding: 0px;&quot;&gt;50&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
         &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
     &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;catch&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;InterruptedException&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; e&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
         &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;System&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;out&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;println&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;color: #008800; margin: 0px; padding: 0px;&quot;&gt;&quot;Thread &quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;  threadName &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;color: #008800; margin: 0px; padding: 0px;&quot;&gt;&quot; interrupted.&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
     &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
     &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;System&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;out&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;println&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;color: #008800; margin: 0px; padding: 0px;&quot;&gt;&quot;Thread &quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;  threadName &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;color: #008800; margin: 0px; padding: 0px;&quot;&gt;&quot; exiting.&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
   &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
   
   &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;public&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;void&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; start &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
   &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
      &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;System&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;out&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;println&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;color: #008800; margin: 0px; padding: 0px;&quot;&gt;&quot;Starting &quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;  threadName &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
      &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;t &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;==&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
      &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
         t &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;Thread&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; threadName&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
         t&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;start &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
      &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
   &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;

&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;

&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;public&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;TestThread&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
   &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;public&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;static&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;void&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; main&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; args&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;[])&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
   
      &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;RunnableDemo&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; R1 &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;RunnableDemo&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;color: #008800; margin: 0px; padding: 0px;&quot;&gt;&quot;Thread-1&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
      R1&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;start&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
      
      &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;RunnableDemo&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; R2 &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;RunnableDemo&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;color: #008800; margin: 0px; padding: 0px;&quot;&gt;&quot;Thread-2&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
      R2&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;start&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
   &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;   
&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;&lt;div style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 12px; margin-bottom: 1em; margin-top: 0.8em; padding: 0px; text-align: justify;&quot;&gt;This would produce the following result:&lt;/div&gt;&lt;pre class=&quot;result&quot; style=&quot;background-color: #f1f1f1; border: 1px solid rgb(214, 214, 214); font-size: 12px; overflow: auto; padding: 5px; width: 549.765625px;&quot;&gt;Creating Thread-1
Starting Thread-1
Creating Thread-2
Starting Thread-2
Running Thread-1
Thread: Thread-1, 4
Running Thread-2
Thread: Thread-2, 4
Thread: Thread-1, 3
Thread: Thread-2, 3
Thread: Thread-1, 2
Thread: Thread-2, 2
Thread: Thread-1, 1
Thread: Thread-2, 1
Thread Thread-1 exiting.
Thread Thread-2 exiting.
&lt;/pre&gt;&lt;h2 style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 1.6em; font-weight: normal; line-height: 1.5em; margin: 0.2em 0.2em 0.2em 0px; padding: 0px; text-shadow: rgb(204, 204, 204) 1px 1px 2px;&quot;&gt;Create Thread by Extending Thread Class:&lt;/h2&gt;&lt;div style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 12px; margin-bottom: 1em; margin-top: 0.8em; padding: 0px; text-align: justify;&quot;&gt;The second way to create a thread is to create a new class that extends&amp;nbsp;&lt;b style=&quot;margin: 0px; padding: 0px;&quot;&gt;Thread&lt;/b&gt;&amp;nbsp;class using the following two simple steps. This approach provides more flexibility in handling multiple threads created using available methods in Thread class.&lt;/div&gt;&lt;h3 style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 1.2em; font-weight: normal; line-height: 1.5em; margin: 0.2em 0.2em 0.2em 0px; padding: 0px; text-shadow: rgb(204, 204, 204) 1px 1px 2px; text-transform: uppercase;&quot;&gt;STEP 1&lt;/h3&gt;&lt;div style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 12px; margin-bottom: 1em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px !important; text-align: justify;&quot;&gt;You will need to override&amp;nbsp;&lt;b style=&quot;margin: 0px; padding: 0px;&quot;&gt;run( )&lt;/b&gt;&amp;nbsp;method available in Thread class. This method provides entry point for the thread and you will put you complete business logic inside this method. Following is simple syntax of run() method:&lt;/div&gt;&lt;pre class=&quot;prettyprint prettyprinted&quot; style=&quot;background-color: #eeeeee; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; border: 1px solid rgb(214, 214, 214); font-size: 12px; margin-bottom: 10px; overflow: auto; padding: 5px; width: 549.765625px;&quot;&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;public&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;void&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; run&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt;&lt;/pre&gt;&lt;h3 style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 1.2em; font-weight: normal; line-height: 1.5em; margin: 0.2em 0.2em 0.2em 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 10px !important; text-shadow: rgb(204, 204, 204) 1px 1px 2px; text-transform: uppercase;&quot;&gt;STEP 2&lt;/h3&gt;&lt;div style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 12px; margin-bottom: 1em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px !important; text-align: justify;&quot;&gt;Once Thread object is created, you can start it by calling&amp;nbsp;&lt;b style=&quot;margin: 0px; padding: 0px;&quot;&gt;start( )&lt;/b&gt;&amp;nbsp;method, which executes a call to run( ) method. Following is simple syntax of start() method:&lt;/div&gt;&lt;pre class=&quot;prettyprint prettyprinted&quot; style=&quot;background-color: #eeeeee; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; border: 1px solid rgb(214, 214, 214); font-size: 12px; margin-bottom: 10px; overflow: auto; padding: 5px; width: 549.765625px;&quot;&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;void&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; start&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;&lt;/pre&gt;&lt;h2 style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 1.6em; font-weight: normal; line-height: 1.5em; margin: 0.2em 0.2em 0.2em 0px; padding: 0px; text-shadow: rgb(204, 204, 204) 1px 1px 2px;&quot;&gt;Example:&lt;/h2&gt;&lt;div style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 12px; margin-bottom: 1em; margin-top: 0.8em; padding: 0px; text-align: justify;&quot;&gt;Here is the preceding program rewritten to extend Thread:&lt;/div&gt;&lt;pre class=&quot;prettyprint tryit prettyprinted&quot; style=&quot;background-attachment: initial !important; background-clip: initial !important; background-color: rgb(238, 238, 238) !important; background-image: url(http://www.tutorialspoint.com/images/link.png) !important; background-origin: initial !important; background-position: 100% 0%; background-repeat: no-repeat !important; background-size: initial !important; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; border: 1px solid rgb(214, 214, 214); font-size: 12px; margin-bottom: 10px; overflow: auto; padding: 5px; width: 549.765625px;&quot;&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;ThreadDemo&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;extends&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;Thread&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
   &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;private&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;Thread&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; t&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
   &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;private&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; threadName&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
   
   &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;ThreadDemo&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; name&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;){&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
       threadName &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; name&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
       &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;System&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;out&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;println&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;color: #008800; margin: 0px; padding: 0px;&quot;&gt;&quot;Creating &quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;  threadName &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
   &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
   &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;public&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;void&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; run&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
      &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;System&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;out&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;println&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;color: #008800; margin: 0px; padding: 0px;&quot;&gt;&quot;Running &quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;  threadName &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
      &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;try&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
         &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;for&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;int&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; i &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666; margin: 0px; padding: 0px;&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; i &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666; margin: 0px; padding: 0px;&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; i&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;--)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
            &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;System&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;out&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;println&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;color: #008800; margin: 0px; padding: 0px;&quot;&gt;&quot;Thread: &quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; threadName &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;color: #008800; margin: 0px; padding: 0px;&quot;&gt;&quot;, &quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; i&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
            &lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;color: #880000; margin: 0px; padding: 0px;&quot;&gt;// Let the thread sleep for a while.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
            &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;Thread&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;sleep&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666; margin: 0px; padding: 0px;&quot;&gt;50&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
         &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
     &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;catch&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;InterruptedException&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; e&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
         &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;System&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;out&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;println&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;color: #008800; margin: 0px; padding: 0px;&quot;&gt;&quot;Thread &quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;  threadName &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;color: #008800; margin: 0px; padding: 0px;&quot;&gt;&quot; interrupted.&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
     &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
     &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;System&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;out&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;println&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;color: #008800; margin: 0px; padding: 0px;&quot;&gt;&quot;Thread &quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;  threadName &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;color: #008800; margin: 0px; padding: 0px;&quot;&gt;&quot; exiting.&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
   &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
   
   &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;public&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;void&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; start &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
   &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
      &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;System&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;out&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;println&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;color: #008800; margin: 0px; padding: 0px;&quot;&gt;&quot;Starting &quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;  threadName &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
      &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;t &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;==&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
      &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
         t &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;Thread&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; threadName&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
         t&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;start &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
      &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
   &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;

&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;

&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;public&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;TestThread&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
   &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;public&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;static&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;void&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; main&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; args&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;[])&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
   
      &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;ThreadDemo&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; T1 &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;ThreadDemo&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;color: #008800; margin: 0px; padding: 0px;&quot;&gt;&quot;Thread-1&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
      T1&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;start&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
      
      &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;ThreadDemo&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; T2 &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;ThreadDemo&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;color: #008800; margin: 0px; padding: 0px;&quot;&gt;&quot;Thread-2&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
      T2&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;start&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
   &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;   
&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;&lt;div style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 12px; margin-bottom: 1em; margin-top: 0.8em; padding: 0px; text-align: justify;&quot;&gt;This would produce the following result:&lt;/div&gt;&lt;pre class=&quot;result&quot; style=&quot;background-color: #f1f1f1; border: 1px solid rgb(214, 214, 214); font-size: 12px; overflow: auto; padding: 5px; width: 549.765625px;&quot;&gt;Creating Thread-1
Starting Thread-1
Creating Thread-2
Starting Thread-2
Running Thread-1
Thread: Thread-1, 4
Running Thread-2
Thread: Thread-2, 4
Thread: Thread-1, 3
Thread: Thread-2, 3
Thread: Thread-1, 2
Thread: Thread-2, 2
Thread: Thread-1, 1
Thread: Thread-2, 1
Thread Thread-1 exiting.
Thread Thread-2 exiting.
&lt;/pre&gt;&lt;h2 style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 1.6em; font-weight: normal; line-height: 1.5em; margin: 0.2em 0.2em 0.2em 0px; padding: 0px; text-shadow: rgb(204, 204, 204) 1px 1px 2px;&quot;&gt;Thread Methods:&lt;/h2&gt;&lt;div style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 12px; margin-bottom: 1em; margin-top: 0.8em; padding: 0px; text-align: justify;&quot;&gt;Following is the list of important methods available in the Thread class.&lt;/div&gt;&lt;table class=&quot;src&quot; style=&quot;background-color: #f7f7f7; border-collapse: collapse; border: 1px solid rgb(214, 214, 214); color: black; font-family: Helvetica, Arial, sans-serif; font-size: 12px; margin: 8px 0px; padding: 0px; vertical-align: top; width: 560px;&quot;&gt;&lt;tbody style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;tr style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;th style=&quot;background-color: #eeeeee; border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;SN&lt;/th&gt;&lt;th style=&quot;background-color: #eeeeee; border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;Methods with Description&lt;/th&gt;&lt;/tr&gt;
&lt;tr style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;1&lt;/td&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;&lt;b style=&quot;margin: 0px; padding: 0px;&quot;&gt;public void start()&lt;/b&gt;&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;Starts the thread in a separate path of execution, then invokes the run() method on this Thread object.&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;2&lt;/td&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;&lt;b style=&quot;margin: 0px; padding: 0px;&quot;&gt;public void run()&lt;/b&gt;&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;If this Thread object was instantiated using a separate Runnable target, the run() method is invoked on that Runnable object.&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;3&lt;/td&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;&lt;b style=&quot;margin: 0px; padding: 0px;&quot;&gt;public final void setName(String name)&lt;/b&gt;&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;Changes the name of the Thread object. There is also a getName() method for retrieving the name.&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;4&lt;/td&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;&lt;b style=&quot;margin: 0px; padding: 0px;&quot;&gt;public final void setPriority(int priority)&lt;/b&gt;&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;Sets the priority of this Thread object. The possible values are between 1 and 10.&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;5&lt;/td&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;&lt;b style=&quot;margin: 0px; padding: 0px;&quot;&gt;public final void setDaemon(boolean on)&lt;/b&gt;&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;A parameter of true denotes this Thread as a daemon thread.&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;6&lt;/td&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;&lt;b style=&quot;margin: 0px; padding: 0px;&quot;&gt;public final void join(long millisec)&lt;/b&gt;&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;The current thread invokes this method on a second thread, causing the current thread to block until the second thread terminates or the specified number of milliseconds passes.&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;7&lt;/td&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;&lt;b style=&quot;margin: 0px; padding: 0px;&quot;&gt;public void interrupt()&lt;/b&gt;&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;Interrupts this thread, causing it to continue execution if it was blocked for any reason.&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;8&lt;/td&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;&lt;b style=&quot;margin: 0px; padding: 0px;&quot;&gt;public final boolean isAlive()&lt;/b&gt;&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;Returns true if the thread is alive, which is any time after the thread has been started but before it runs to completion.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;div style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 12px; margin-bottom: 1em; margin-top: 0.8em; padding: 0px; text-align: justify;&quot;&gt;The previous methods are invoked on a particular Thread object. The following methods in the Thread class are static. Invoking one of the static methods performs the operation on the currently running thread.&lt;/div&gt;&lt;table class=&quot;src&quot; style=&quot;background-color: #f7f7f7; border-collapse: collapse; border: 1px solid rgb(214, 214, 214); color: black; font-family: Helvetica, Arial, sans-serif; font-size: 12px; margin: 8px 0px; padding: 0px; vertical-align: top; width: 560px;&quot;&gt;&lt;tbody style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;tr style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;th style=&quot;background-color: #eeeeee; border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;SN&lt;/th&gt;&lt;th style=&quot;background-color: #eeeeee; border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;Methods with Description&lt;/th&gt;&lt;/tr&gt;
&lt;tr style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;1&lt;/td&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;&lt;b style=&quot;margin: 0px; padding: 0px;&quot;&gt;public static void yield()&lt;/b&gt;&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;Causes the currently running thread to yield to any other threads of the same priority that are waiting to be scheduled.&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;2&lt;/td&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;&lt;b style=&quot;margin: 0px; padding: 0px;&quot;&gt;public static void sleep(long millisec)&lt;/b&gt;&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;Causes the currently running thread to block for at least the specified number of milliseconds.&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;3&lt;/td&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;&lt;b style=&quot;margin: 0px; padding: 0px;&quot;&gt;public static boolean holdsLock(Object x)&lt;/b&gt;&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;Returns true if the current thread holds the lock on the given Object.&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;4&lt;/td&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;&lt;b style=&quot;margin: 0px; padding: 0px;&quot;&gt;public static Thread currentThread()&lt;/b&gt;&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;Returns a reference to the currently running thread, which is the thread that invokes this method.&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;5&lt;/td&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;&lt;b style=&quot;margin: 0px; padding: 0px;&quot;&gt;public static void dumpStack()&lt;/b&gt;&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;Prints the stack trace for the currently running thread, which is useful when debugging a multithreaded application.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;h2 style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 1.6em; font-weight: normal; line-height: 1.5em; margin: 0.2em 0.2em 0.2em 0px; padding: 0px; text-shadow: rgb(204, 204, 204) 1px 1px 2px;&quot;&gt;Example:&lt;/h2&gt;&lt;div style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 12px; margin-bottom: 1em; margin-top: 0.8em; padding: 0px; text-align: justify;&quot;&gt;The following ThreadClassDemo program demonstrates some of these methods of the Thread class. Consider a class&amp;nbsp;&lt;b style=&quot;margin: 0px; padding: 0px;&quot;&gt;DisplayMessage&lt;/b&gt;&amp;nbsp;which implements&amp;nbsp;&lt;b style=&quot;margin: 0px; padding: 0px;&quot;&gt;Runnable&lt;/b&gt;:&lt;/div&gt;&lt;pre class=&quot;prettyprint prettyprinted&quot; id=&quot;util&quot; style=&quot;background-color: #eeeeee; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; border: 1px solid rgb(214, 214, 214); font-size: 12px; margin-bottom: 10px; overflow: auto; padding: 5px; width: 549.765625px;&quot;&gt;&lt;span class=&quot;com&quot; style=&quot;color: #880000; margin: 0px; padding: 0px;&quot;&gt;// File Name : DisplayMessage.java&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;color: #880000; margin: 0px; padding: 0px;&quot;&gt;// Create a thread to implement Runnable&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;public&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;DisplayMessage&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;implements&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;Runnable&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
   &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;private&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; message&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
   &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;public&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;DisplayMessage&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; message&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
   &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
      &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;message &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; message&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
   &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
   &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;public&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;void&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; run&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
   &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
      &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;while&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
      &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
         &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;System&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;out&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;println&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;message&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
      &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
   &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;&lt;div style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 12px; margin-bottom: 1em; margin-top: 0.8em; padding: 0px; text-align: justify;&quot;&gt;Following is another class which extends Thread class:&lt;/div&gt;&lt;pre class=&quot;prettyprint prettyprinted&quot; id=&quot;support&quot; style=&quot;background-color: #eeeeee; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; border: 1px solid rgb(214, 214, 214); font-size: 12px; margin-bottom: 10px; overflow: auto; padding: 5px; width: 549.765625px;&quot;&gt;&lt;span class=&quot;com&quot; style=&quot;color: #880000; margin: 0px; padding: 0px;&quot;&gt;// File Name : GuessANumber.java&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;color: #880000; margin: 0px; padding: 0px;&quot;&gt;// Create a thread to extentd Thread&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;public&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;GuessANumber&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;extends&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;Thread&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
   &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;private&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;int&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; number&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
   &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;public&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;GuessANumber&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;int&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; number&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
   &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
      &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;number &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; number&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
   &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
   &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;public&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;void&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; run&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
   &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
      &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;int&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; counter &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666; margin: 0px; padding: 0px;&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
      &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;int&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; guess &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666; margin: 0px; padding: 0px;&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
      &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;do&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
      &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
          guess &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;int&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;Math&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;random&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666; margin: 0px; padding: 0px;&quot;&gt;100&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666; margin: 0px; padding: 0px;&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
          &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;System&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;out&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;println&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;getName&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
                       &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;color: #008800; margin: 0px; padding: 0px;&quot;&gt;&quot; guesses &quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; guess&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
          counter&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;++;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
      &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;while&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;guess &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;!=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; number&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
      &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;System&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;out&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;println&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;color: #008800; margin: 0px; padding: 0px;&quot;&gt;&quot;** Correct! &quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;getName&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
                       &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;color: #008800; margin: 0px; padding: 0px;&quot;&gt;&quot; in &quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; counter &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;color: #008800; margin: 0px; padding: 0px;&quot;&gt;&quot; guesses.**&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
   &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;&lt;div style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 12px; margin-bottom: 1em; margin-top: 0.8em; padding: 0px; text-align: justify;&quot;&gt;Following is the main program which makes use of above defined classes:&lt;/div&gt;&lt;pre class=&quot;prettyprint tryit prettyprinted&quot; style=&quot;background-attachment: initial !important; background-clip: initial !important; background-color: rgb(238, 238, 238) !important; background-image: url(http://www.tutorialspoint.com/images/link.png) !important; background-origin: initial !important; background-position: 100% 0%; background-repeat: no-repeat !important; background-size: initial !important; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; border: 1px solid rgb(214, 214, 214); font-size: 12px; margin-bottom: 10px; overflow: auto; padding: 5px; width: 549.765625px;&quot; title=&quot;support, util&quot;&gt;&lt;span class=&quot;com&quot; style=&quot;color: #880000; margin: 0px; padding: 0px;&quot;&gt;// File Name : ThreadClassDemo.java&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;public&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;ThreadClassDemo&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
   &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;public&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;static&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;void&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; main&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;[]&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; args&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
   &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
      &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;Runnable&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; hello &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;DisplayMessage&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;color: #008800; margin: 0px; padding: 0px;&quot;&gt;&quot;Hello&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
      &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;Thread&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; thread1 &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;Thread&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;hello&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
      thread1&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;setDaemon&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
      thread1&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;setName&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;color: #008800; margin: 0px; padding: 0px;&quot;&gt;&quot;hello&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
      &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;System&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;out&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;println&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;color: #008800; margin: 0px; padding: 0px;&quot;&gt;&quot;Starting hello thread...&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
      thread1&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;start&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
      
      &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;Runnable&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; bye &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;DisplayMessage&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;color: #008800; margin: 0px; padding: 0px;&quot;&gt;&quot;Goodbye&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
      &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;Thread&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; thread2 &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;Thread&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;bye&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
      thread2&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;setPriority&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;Thread&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;MIN_PRIORITY&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
      thread2&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;setDaemon&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
      &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;System&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;out&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;println&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;color: #008800; margin: 0px; padding: 0px;&quot;&gt;&quot;Starting goodbye thread...&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
      thread2&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;start&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;

      &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;System&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;out&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;println&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;color: #008800; margin: 0px; padding: 0px;&quot;&gt;&quot;Starting thread3...&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
      &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;Thread&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; thread3 &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;GuessANumber&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666; margin: 0px; padding: 0px;&quot;&gt;27&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
      thread3&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;start&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
      &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;try&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
      &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
         thread3&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;join&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
      &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;catch&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;InterruptedException&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; e&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
      &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
         &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;System&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;out&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;println&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;color: #008800; margin: 0px; padding: 0px;&quot;&gt;&quot;Thread interrupted.&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
      &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
      &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;System&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;out&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;println&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;color: #008800; margin: 0px; padding: 0px;&quot;&gt;&quot;Starting thread4...&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
      &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;Thread&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; thread4 &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;GuessANumber&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666; margin: 0px; padding: 0px;&quot;&gt;75&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
      
   thread4&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;start&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
      &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;System&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;out&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;println&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;color: #008800; margin: 0px; padding: 0px;&quot;&gt;&quot;main() is ending...&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
   &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;&lt;div style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 12px; margin-bottom: 1em; margin-top: 0.8em; padding: 0px; text-align: justify;&quot;&gt;This would produce the following result. You can try this example again and again and you would get different result every time.&lt;/div&gt;&lt;pre class=&quot;prettyprint prettyprinted&quot; style=&quot;background-color: #eeeeee; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; border: 1px solid rgb(214, 214, 214); font-size: 12px; margin-bottom: 10px; overflow: auto; padding: 5px; width: 549.765625px;&quot;&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;Starting&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; hello thread&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;Starting&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; goodbye thread&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;Hello&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;Hello&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;Hello&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;Hello&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;Hello&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;Hello&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;Goodbye&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;Goodbye&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;Goodbye&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;Goodbye&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;Goodbye&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.......&lt;/span&gt;&lt;/pre&gt;&lt;h2 style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 1.6em; font-weight: normal; line-height: 1.5em; margin: 0.2em 0.2em 0.2em 0px; padding: 0px; text-shadow: rgb(204, 204, 204) 1px 1px 2px;&quot;&gt;Major Java Multithreading Concepts:&lt;/h2&gt;&lt;div style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 12px; margin-bottom: 1em; margin-top: 0.8em; padding: 0px; text-align: justify;&quot;&gt;While doing Multithreading programming in Java, you would need to have the following concepts very handy:&lt;/div&gt;&lt;ul class=&quot;list&quot; style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 12px; list-style: none; margin: 0px; padding: 0px 0px 0px 15px;&quot;&gt;&lt;li style=&quot;background: url(http://www.tutorialspoint.com/images/icon-bullet.png) 0px 0px no-repeat; margin: 0px; padding: 0px 0px 0px 19px;&quot;&gt;&lt;div style=&quot;margin-bottom: 1em; margin-top: 0.8em; padding: 0px; text-align: justify;&quot;&gt;&lt;a href=&quot;http://www.tutorialspoint.com/java/java_thread_synchronization.htm&quot; style=&quot;background-color: transparent; color: #900b09; margin: 0px; padding: 0px; text-decoration: none;&quot;&gt;What is thread synchronization?&lt;/a&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&quot;background: url(http://www.tutorialspoint.com/images/icon-bullet.png) 0px 0px no-repeat; margin: 0px; padding: 0px 0px 0px 19px;&quot;&gt;&lt;div style=&quot;margin-bottom: 1em; margin-top: 0.8em; padding: 0px; text-align: justify;&quot;&gt;&lt;a href=&quot;http://www.tutorialspoint.com/java/java_thread_communication.htm&quot; style=&quot;background-color: transparent; color: #900b09; margin: 0px; padding: 0px; text-decoration: none;&quot;&gt;Handling threads inter communication&lt;/a&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&quot;background: url(http://www.tutorialspoint.com/images/icon-bullet.png) 0px 0px no-repeat; margin: 0px; padding: 0px 0px 0px 19px;&quot;&gt;&lt;div style=&quot;margin-bottom: 1em; margin-top: 0.8em; padding: 0px; text-align: justify;&quot;&gt;&lt;a href=&quot;http://www.tutorialspoint.com/java/java_thread_deadlock.htm&quot; style=&quot;background-color: transparent; color: #900b09; margin: 0px; padding: 0px; text-decoration: none;&quot;&gt;Handling thread deadlock&lt;/a&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li style=&quot;background: url(http://www.tutorialspoint.com/images/icon-bullet.png) 0px 0px no-repeat; margin: 0px; padding: 0px 0px 0px 19px;&quot;&gt;&lt;div style=&quot;margin-bottom: 1em; margin-top: 0.8em; padding: 0px; text-align: justify;&quot;&gt;&lt;a href=&quot;http://www.tutorialspoint.com/java/java_thread_control.htm&quot; style=&quot;background-color: transparent; color: #900b09; margin: 0px; padding: 0px; text-decoration: none;&quot;&gt;Major thread operations&lt;/a&gt;&lt;/div&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;br style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 12px; margin: 0px; padding: 0px;&quot; /&gt;&lt;br /&gt;
&lt;br /&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.tutorialspoint.com/java/java_multithreading.htm#.U8eNShzytTA.blogger&quot;&gt;Java - Multithreading Programming Tutorial&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://bridroid.blogspot.com/feeds/3356009070500227243/comments/default' title='댓글'/><link rel='replies' type='text/html' href='http://bridroid.blogspot.com/2014/07/java-multithreading-programming-tutorial.html#comment-form' title='0개의 덧글'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/905901812770512183/posts/default/3356009070500227243'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/905901812770512183/posts/default/3356009070500227243'/><link rel='alternate' type='text/html' href='http://bridroid.blogspot.com/2014/07/java-multithreading-programming-tutorial.html' title='Java - Multithreading Programming Tutorial'/><author><name>brith1225</name><uri>http://www.blogger.com/profile/15293023387175369557</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-905901812770512183.post-8275078858082688621</id><published>2014-07-17T01:44:00.003-07:00</published><updated>2014-07-17T01:46:21.667-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="java"/><title type='text'>Java Collections Framework Tutorial</title><content type='html'>&lt;div style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 12px; margin-bottom: 1em; margin-top: 0.8em; padding: 0px; text-align: justify;&quot;&gt;Prior to Java 2, Java provided ad hoc classes such as&amp;nbsp;&lt;b style=&quot;margin: 0px; padding: 0px;&quot;&gt;Dictionary, Vector, Stack&lt;/b&gt;, and&amp;nbsp;&lt;b style=&quot;margin: 0px; padding: 0px;&quot;&gt;Properties&lt;/b&gt;&amp;nbsp;to store and manipulate groups of objects. Although these classes were quite useful, they lacked a central, unifying theme. Thus, the way that you used Vector was different from the way that you used Properties.&lt;/div&gt;&lt;div style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 12px; margin-bottom: 1em; margin-top: 0.8em; padding: 0px; text-align: justify;&quot;&gt;The collections framework was designed to meet several goals.&lt;/div&gt;&lt;ul class=&quot;list&quot; style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 12px; list-style: none; margin: 0px; padding: 0px 0px 0px 15px;&quot;&gt;&lt;li style=&quot;background: url(http://www.tutorialspoint.com/images/icon-bullet.png) 0px 0px no-repeat; margin: 0px; padding: 0px 0px 0px 19px;&quot;&gt;&lt;div style=&quot;margin-bottom: 1em; margin-top: 0.8em; padding: 0px; text-align: justify;&quot;&gt;The framework had to be high-performance. The implementations for the fundamental collections (dynamic arrays, linked lists, trees, and hashtables) are highly efficient.&lt;/div&gt;&lt;/li&gt;
&lt;li style=&quot;background: url(http://www.tutorialspoint.com/images/icon-bullet.png) 0px 0px no-repeat; margin: 0px; padding: 0px 0px 0px 19px;&quot;&gt;&lt;div style=&quot;margin-bottom: 1em; margin-top: 0.8em; padding: 0px; text-align: justify;&quot;&gt;The framework had to allow different types of collections to work in a similar manner and with a high degree of interoperability.&lt;/div&gt;&lt;/li&gt;
&lt;li style=&quot;background: url(http://www.tutorialspoint.com/images/icon-bullet.png) 0px 0px no-repeat; margin: 0px; padding: 0px 0px 0px 19px;&quot;&gt;&lt;div style=&quot;margin-bottom: 1em; margin-top: 0.8em; padding: 0px; text-align: justify;&quot;&gt;Extending and/or adapting a collection had to be easy.&lt;/div&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;div style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 12px; margin-bottom: 1em; margin-top: 0.8em; padding: 0px; text-align: justify;&quot;&gt;Towards this end, the entire collections framework is designed around a set of standard interfaces. Several standard implementations such as&amp;nbsp;&lt;b style=&quot;margin: 0px; padding: 0px;&quot;&gt;LinkedList, HashSet,&lt;/b&gt;&amp;nbsp;and&amp;nbsp;&lt;b style=&quot;margin: 0px; padding: 0px;&quot;&gt;TreeSet&lt;/b&gt;, of these interfaces are provided that you may use as-is and you may also implement your own collection, if you choose.&lt;/div&gt;&lt;div style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 12px; margin-bottom: 1em; margin-top: 0.8em; padding: 0px; text-align: justify;&quot;&gt;A collections framework is a unified architecture for representing and manipulating collections. All collections frameworks contain the following:&lt;/div&gt;&lt;ul class=&quot;list&quot; style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 12px; list-style: none; margin: 0px; padding: 0px 0px 0px 15px;&quot;&gt;&lt;li style=&quot;background: url(http://www.tutorialspoint.com/images/icon-bullet.png) 0px 0px no-repeat; margin: 0px; padding: 0px 0px 0px 19px;&quot;&gt;&lt;div style=&quot;margin-bottom: 1em; margin-top: 0.8em; padding: 0px; text-align: justify;&quot;&gt;&lt;b style=&quot;margin: 0px; padding: 0px;&quot;&gt;Interfaces:&lt;/b&gt;&amp;nbsp;These are abstract data types that represent collections. Interfaces allow collections to be manipulated independently of the details of their representation. In object-oriented languages, interfaces generally form a hierarchy.&lt;/div&gt;&lt;/li&gt;
&lt;li style=&quot;background: url(http://www.tutorialspoint.com/images/icon-bullet.png) 0px 0px no-repeat; margin: 0px; padding: 0px 0px 0px 19px;&quot;&gt;&lt;div style=&quot;margin-bottom: 1em; margin-top: 0.8em; padding: 0px; text-align: justify;&quot;&gt;&lt;b style=&quot;margin: 0px; padding: 0px;&quot;&gt;Implementations, i.e., Classes:&lt;/b&gt;&amp;nbsp;These are the concrete implementations of the collection interfaces. In essence, they are reusable data structures.&lt;/div&gt;&lt;/li&gt;
&lt;li style=&quot;background: url(http://www.tutorialspoint.com/images/icon-bullet.png) 0px 0px no-repeat; margin: 0px; padding: 0px 0px 0px 19px;&quot;&gt;&lt;div style=&quot;margin-bottom: 1em; margin-top: 0.8em; padding: 0px; text-align: justify;&quot;&gt;&lt;b style=&quot;margin: 0px; padding: 0px;&quot;&gt;Algorithms:&lt;/b&gt;&amp;nbsp;These are the methods that perform useful computations, such as searching and sorting, on objects that implement collection interfaces. The algorithms are said to be polymorphic: that is, the same method can be used on many different implementations of the appropriate collection interface.&lt;/div&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;div style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 12px; margin-bottom: 1em; margin-top: 0.8em; padding: 0px; text-align: justify;&quot;&gt;In addition to collections, the framework defines several map interfaces and classes. Maps store key/value pairs. Although maps are not&amp;nbsp;&lt;i style=&quot;margin: 0px; padding: 0px;&quot;&gt;collections&lt;/i&gt;&amp;nbsp;in the proper use of the term, but they are fully integrated with collections.&lt;/div&gt;&lt;h2 style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 1.6em; font-weight: normal; line-height: 1.5em; margin: 0.2em 0.2em 0.2em 0px; padding: 0px; text-shadow: rgb(204, 204, 204) 1px 1px 2px;&quot;&gt;The Collection Interfaces:&lt;/h2&gt;&lt;div style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 12px; margin-bottom: 1em; margin-top: 0.8em; padding: 0px; text-align: justify;&quot;&gt;The collections framework defines several interfaces. This section provides an overview of each interface:&lt;/div&gt;&lt;table class=&quot;src&quot; style=&quot;background-color: #f7f7f7; border-collapse: collapse; border: 1px solid rgb(214, 214, 214); color: black; font-family: Helvetica, Arial, sans-serif; font-size: 12px; margin: 8px 0px; padding: 0px; vertical-align: top; width: 560px;&quot;&gt;&lt;tbody style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;tr style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;th style=&quot;background-color: #eeeeee; border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;SN&lt;/th&gt;&lt;th style=&quot;background-color: #eeeeee; border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;Interfaces with Description&lt;/th&gt;&lt;/tr&gt;
&lt;tr style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;1&lt;/td&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;&lt;a href=&quot;http://www.tutorialspoint.com/java/java_collection_interface.htm&quot; style=&quot;background-color: transparent; color: #900b09; margin: 0px; padding: 0px; text-decoration: none;&quot;&gt;The Collection Interface&lt;/a&gt;&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;This enables you to work with groups of objects; it is at the top of the collections hierarchy.&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;2&lt;/td&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;&lt;a href=&quot;http://www.tutorialspoint.com/java/java_list_interface.htm&quot; style=&quot;background-color: transparent; color: #900b09; margin: 0px; padding: 0px; text-decoration: none;&quot;&gt;The List Interface&lt;/a&gt;&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;This extends&amp;nbsp;&lt;b style=&quot;margin: 0px; padding: 0px;&quot;&gt;Collection&lt;/b&gt;&amp;nbsp;and an instance of List stores an ordered collection of elements.&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;3&lt;/td&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;&lt;a href=&quot;http://www.tutorialspoint.com/java/java_set_interface.htm&quot; style=&quot;background-color: transparent; color: #900b09; margin: 0px; padding: 0px; text-decoration: none;&quot;&gt;The Set&lt;/a&gt;&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;This extends Collection to handle sets, which must contain unique elements&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;4&lt;/td&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;&lt;a href=&quot;http://www.tutorialspoint.com/java/java_sortedset_interface.htm&quot; style=&quot;background-color: transparent; color: #900b09; margin: 0px; padding: 0px; text-decoration: none;&quot;&gt;The SortedSet&lt;/a&gt;&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;This extends Set to handle sorted sets&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;5&lt;/td&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;&lt;a href=&quot;http://www.tutorialspoint.com/java/java_map_interface.htm&quot; style=&quot;background-color: transparent; color: #900b09; margin: 0px; padding: 0px; text-decoration: none;&quot;&gt;The Map&lt;/a&gt;&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;This maps unique keys to values.&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;6&lt;/td&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;&lt;a href=&quot;http://www.tutorialspoint.com/java/java_mapentry_interface.htm&quot; style=&quot;background-color: transparent; color: #900b09; margin: 0px; padding: 0px; text-decoration: none;&quot;&gt;The Map.Entry&lt;/a&gt;&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;This describes an element (a key/value pair) in a map. This is an inner class of Map.&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;7&lt;/td&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;&lt;a href=&quot;http://www.tutorialspoint.com/java/java_sortedmap_interface.htm&quot; style=&quot;background-color: transparent; color: #900b09; margin: 0px; padding: 0px; text-decoration: none;&quot;&gt;The SortedMap&lt;/a&gt;&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;This extends Map so that the keys are maintained in ascending order.&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;8&lt;/td&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;&lt;a href=&quot;http://www.tutorialspoint.com/java/java_enumeration_interface.htm&quot; style=&quot;background-color: transparent; color: #900b09; margin: 0px; padding: 0px; text-decoration: none;&quot;&gt;The Enumeration&lt;/a&gt;&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;This is legacy interface and defines the methods by which you can enumerate (obtain one at a time) the elements in a collection of objects. This legacy interface has been superceded by Iterator.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;h2 style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 1.6em; font-weight: normal; line-height: 1.5em; margin: 0.2em 0.2em 0.2em 0px; padding: 0px; text-shadow: rgb(204, 204, 204) 1px 1px 2px;&quot;&gt;The Collection Classes:&lt;/h2&gt;&lt;div style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 12px; margin-bottom: 1em; margin-top: 0.8em; padding: 0px; text-align: justify;&quot;&gt;Java provides a set of standard collection classes that implement Collection interfaces. Some of the classes provide full implementations that can be used as-is and others are abstract class, providing skeletal implementations that are used as starting points for creating concrete collections.&lt;/div&gt;&lt;div style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 12px; margin-bottom: 1em; margin-top: 0.8em; padding: 0px; text-align: justify;&quot;&gt;The standard collection classes are summarized in the following table:&lt;/div&gt;&lt;table class=&quot;src&quot; style=&quot;background-color: #f7f7f7; border-collapse: collapse; border: 1px solid rgb(214, 214, 214); color: black; font-family: Helvetica, Arial, sans-serif; font-size: 12px; margin: 8px 0px; padding: 0px; vertical-align: top; width: 560px;&quot;&gt;&lt;tbody style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;tr style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;th style=&quot;background-color: #eeeeee; border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;SN&lt;/th&gt;&lt;th style=&quot;background-color: #eeeeee; border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;Classes with Description&lt;/th&gt;&lt;/tr&gt;
&lt;tr style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;1&lt;/td&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;&lt;b style=&quot;margin: 0px; padding: 0px;&quot;&gt;AbstractCollection&amp;nbsp;&lt;/b&gt;&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;Implements most of the Collection interface.&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;2&lt;/td&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;&lt;b style=&quot;margin: 0px; padding: 0px;&quot;&gt;AbstractList&amp;nbsp;&lt;/b&gt;&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;Extends AbstractCollection and implements most of the List interface.&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;3&lt;/td&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;&lt;b style=&quot;margin: 0px; padding: 0px;&quot;&gt;AbstractSequentialList&amp;nbsp;&lt;/b&gt;&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;Extends AbstractList for use by a collection that uses sequential rather than random access of its elements.&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;4&lt;/td&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;&lt;a href=&quot;http://www.tutorialspoint.com/java/java_linkedlist_class.htm&quot; style=&quot;background-color: transparent; color: #900b09; margin: 0px; padding: 0px; text-decoration: none;&quot;&gt;LinkedList&amp;nbsp;&lt;/a&gt;&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;Implements a linked list by extending AbstractSequentialList.&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;5&lt;/td&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;&lt;a href=&quot;http://www.tutorialspoint.com/java/java_arraylist_class.htm&quot; style=&quot;background-color: transparent; color: #900b09; margin: 0px; padding: 0px; text-decoration: none;&quot;&gt;ArrayList&amp;nbsp;&lt;/a&gt;&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;Implements a dynamic array by extending AbstractList.&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;6&lt;/td&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;&lt;b style=&quot;margin: 0px; padding: 0px;&quot;&gt;AbstractSet&amp;nbsp;&lt;/b&gt;&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;Extends AbstractCollection and implements most of the Set interface.&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;7&lt;/td&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;&lt;a href=&quot;http://www.tutorialspoint.com/java/java_hashset_class.htm&quot; style=&quot;background-color: transparent; color: #900b09; margin: 0px; padding: 0px; text-decoration: none;&quot;&gt;HashSet&amp;nbsp;&lt;/a&gt;&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;Extends AbstractSet for use with a hash table.&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;8&lt;/td&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;&lt;a href=&quot;http://www.tutorialspoint.com/java/java_linkedhashset_class.htm&quot; style=&quot;background-color: transparent; color: #900b09; margin: 0px; padding: 0px; text-decoration: none;&quot;&gt;LinkedHashSet&amp;nbsp;&lt;/a&gt;&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;Extends HashSet to allow insertion-order iterations.&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;9&lt;/td&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;&lt;a href=&quot;http://www.tutorialspoint.com/java/java_treeset_class.htm&quot; style=&quot;background-color: transparent; color: #900b09; margin: 0px; padding: 0px; text-decoration: none;&quot;&gt;TreeSet&amp;nbsp;&lt;/a&gt;&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;Implements a set stored in a tree. Extends AbstractSet.&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;10&lt;/td&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;&lt;b style=&quot;margin: 0px; padding: 0px;&quot;&gt;AbstractMap&amp;nbsp;&lt;/b&gt;&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;Implements most of the Map interface.&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;11&lt;/td&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;&lt;a href=&quot;http://www.tutorialspoint.com/java/java_hashmap_class.htm&quot; style=&quot;background-color: transparent; color: #900b09; margin: 0px; padding: 0px; text-decoration: none;&quot;&gt;HashMap&amp;nbsp;&lt;/a&gt;&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;Extends AbstractMap to use a hash table.&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;12&lt;/td&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;&lt;a href=&quot;http://www.tutorialspoint.com/java/java_treemap_class.htm&quot; style=&quot;background-color: transparent; color: #900b09; margin: 0px; padding: 0px; text-decoration: none;&quot;&gt;TreeMap&amp;nbsp;&lt;/a&gt;&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;Extends AbstractMap to use a tree.&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;13&lt;/td&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;&lt;a href=&quot;http://www.tutorialspoint.com/java/java_weakhashmap_class.htm&quot; style=&quot;background-color: transparent; color: #900b09; margin: 0px; padding: 0px; text-decoration: none;&quot;&gt;WeakHashMap&amp;nbsp;&lt;/a&gt;&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;Extends AbstractMap to use a hash table with weak keys.&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;14&lt;/td&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;&lt;a href=&quot;http://www.tutorialspoint.com/java/java_linkedhashmap_class.htm&quot; style=&quot;background-color: transparent; color: #900b09; margin: 0px; padding: 0px; text-decoration: none;&quot;&gt;LinkedHashMap&amp;nbsp;&lt;/a&gt;&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;Extends HashMap to allow insertion-order iterations.&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;15&lt;/td&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;&lt;a href=&quot;http://www.tutorialspoint.com/java/java_identityhashmap_class.htm&quot; style=&quot;background-color: transparent; color: #900b09; margin: 0px; padding: 0px; text-decoration: none;&quot;&gt;IdentityHashMap&amp;nbsp;&lt;/a&gt;&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;Extends AbstractMap and uses reference equality when comparing documents.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;div style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 12px; margin-bottom: 1em; margin-top: 0.8em; padding: 0px; text-align: justify;&quot;&gt;The&amp;nbsp;&lt;i style=&quot;margin: 0px; padding: 0px;&quot;&gt;AbstractCollection, AbstractSet, AbstractList, AbstractSequentialList&lt;/i&gt;&amp;nbsp;and&amp;nbsp;&lt;i style=&quot;margin: 0px; padding: 0px;&quot;&gt;AbstractMap&lt;/i&gt;&amp;nbsp;classes provide skeletal implementations of the core collection interfaces, to minimize the effort required to implement them.&lt;/div&gt;&lt;div style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 12px; margin-bottom: 1em; margin-top: 0.8em; padding: 0px; text-align: justify;&quot;&gt;The following legacy classes defined by java.util have been discussed in previous tutorial:&lt;/div&gt;&lt;table class=&quot;src&quot; style=&quot;background-color: #f7f7f7; border-collapse: collapse; border: 1px solid rgb(214, 214, 214); color: black; font-family: Helvetica, Arial, sans-serif; font-size: 12px; margin: 8px 0px; padding: 0px; vertical-align: top; width: 560px;&quot;&gt;&lt;tbody style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;tr style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;th style=&quot;background-color: #eeeeee; border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;SN&lt;/th&gt;&lt;th style=&quot;background-color: #eeeeee; border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;Classes with Description&lt;/th&gt;&lt;/tr&gt;
&lt;tr style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;1&lt;/td&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;&lt;a href=&quot;http://www.tutorialspoint.com/java/java_vector_class.htm&quot; style=&quot;background-color: transparent; color: #900b09; margin: 0px; padding: 0px; text-decoration: none;&quot;&gt;Vector&amp;nbsp;&lt;/a&gt;&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;This implements a dynamic array. It is similar to ArrayList, but with some differences.&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;2&lt;/td&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;&lt;a href=&quot;http://www.tutorialspoint.com/java/java_stack_class.htm&quot; style=&quot;background-color: transparent; color: #900b09; margin: 0px; padding: 0px; text-decoration: none;&quot;&gt;Stack&amp;nbsp;&lt;/a&gt;&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;Stack is a subclass of Vector that implements a standard last-in, first-out stack.&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;3&lt;/td&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;&lt;a href=&quot;http://www.tutorialspoint.com/java/java_dictionary_class.htm&quot; style=&quot;background-color: transparent; color: #900b09; margin: 0px; padding: 0px; text-decoration: none;&quot;&gt;Dictionary&lt;/a&gt;&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;Dictionary is an abstract class that represents a key/value storage repository and operates much like Map.&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;4&lt;/td&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;&lt;a href=&quot;http://www.tutorialspoint.com/java/java_hashtable_class.htm&quot; style=&quot;background-color: transparent; color: #900b09; margin: 0px; padding: 0px; text-decoration: none;&quot;&gt;Hashtable&lt;/a&gt;&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;Hashtable was part of the original java.util and is a concrete implementation of a Dictionary.&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;5&lt;/td&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;&lt;a href=&quot;http://www.tutorialspoint.com/java/java_properties_class.htm&quot; style=&quot;background-color: transparent; color: #900b09; margin: 0px; padding: 0px; text-decoration: none;&quot;&gt;Properties&lt;/a&gt;&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;Properties is a subclass of Hashtable. It is used to maintain lists of values in which the key is a String and the value is also a String.&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;6&lt;/td&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;&lt;a href=&quot;http://www.tutorialspoint.com/java/java_bitset_class.htm&quot; style=&quot;background-color: transparent; color: #900b09; margin: 0px; padding: 0px; text-decoration: none;&quot;&gt;BitSet&lt;/a&gt;&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;A BitSet class creates a special type of array that holds bit values. This array can increase in size as needed.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;h2 style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 1.6em; font-weight: normal; line-height: 1.5em; margin: 0.2em 0.2em 0.2em 0px; padding: 0px; text-shadow: rgb(204, 204, 204) 1px 1px 2px;&quot;&gt;The Collection Algorithms:&lt;/h2&gt;&lt;div style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 12px; margin-bottom: 1em; margin-top: 0.8em; padding: 0px; text-align: justify;&quot;&gt;The collections framework defines several algorithms that can be applied to collections and maps. These algorithms are defined as static methods within the Collections class.&lt;/div&gt;&lt;div style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 12px; margin-bottom: 1em; margin-top: 0.8em; padding: 0px; text-align: justify;&quot;&gt;Several of the methods can throw a&amp;nbsp;&lt;b style=&quot;margin: 0px; padding: 0px;&quot;&gt;ClassCastException&lt;/b&gt;, which occurs when an attempt is made to compare incompatible types, or an&amp;nbsp;&lt;b style=&quot;margin: 0px; padding: 0px;&quot;&gt;UnsupportedOperationException&lt;/b&gt;, which occurs when an attempt is made to modify an unmodifiable collection.&lt;/div&gt;&lt;div style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 12px; margin-bottom: 1em; margin-top: 0.8em; padding: 0px; text-align: justify;&quot;&gt;Collections define three static variables: EMPTY_SET, EMPTY_LIST, and EMPTY_MAP. All are immutable.&lt;/div&gt;&lt;table class=&quot;src&quot; style=&quot;background-color: #f7f7f7; border-collapse: collapse; border: 1px solid rgb(214, 214, 214); color: black; font-family: Helvetica, Arial, sans-serif; font-size: 12px; margin: 8px 0px; padding: 0px; vertical-align: top; width: 560px;&quot;&gt;&lt;tbody style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;tr style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;th style=&quot;background-color: #eeeeee; border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;SN&lt;/th&gt;&lt;th style=&quot;background-color: #eeeeee; border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;Algorithms with Description&lt;/th&gt;&lt;/tr&gt;
&lt;tr style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;1&lt;/td&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;&lt;a href=&quot;http://www.tutorialspoint.com/java/java_collection_algorithms.htm&quot; style=&quot;background-color: transparent; color: #900b09; margin: 0px; padding: 0px; text-decoration: none;&quot;&gt;The Collection Algorithms&lt;/a&gt;&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;Here is a list of all the algorithm implementation.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;h2 style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 1.6em; font-weight: normal; line-height: 1.5em; margin: 0.2em 0.2em 0.2em 0px; padding: 0px; text-shadow: rgb(204, 204, 204) 1px 1px 2px;&quot;&gt;How to use an Iterator ?&lt;/h2&gt;&lt;div style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 12px; margin-bottom: 1em; margin-top: 0.8em; padding: 0px; text-align: justify;&quot;&gt;Often, you will want to cycle through the elements in a collection. For example, you might want to display each element.&lt;/div&gt;&lt;div style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 12px; margin-bottom: 1em; margin-top: 0.8em; padding: 0px; text-align: justify;&quot;&gt;The easiest way to do this is to employ an iterator, which is an object that implements either the Iterator or the ListIterator interface.&lt;/div&gt;&lt;div style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 12px; margin-bottom: 1em; margin-top: 0.8em; padding: 0px; text-align: justify;&quot;&gt;Iterator enables you to cycle through a collection, obtaining or removing elements. ListIterator extends Iterator to allow bidirectional traversal of a list and the modification of elements.&lt;/div&gt;&lt;table class=&quot;src&quot; style=&quot;background-color: #f7f7f7; border-collapse: collapse; border: 1px solid rgb(214, 214, 214); color: black; font-family: Helvetica, Arial, sans-serif; font-size: 12px; margin: 8px 0px; padding: 0px; vertical-align: top; width: 560px;&quot;&gt;&lt;tbody style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;tr style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;th style=&quot;background-color: #eeeeee; border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;SN&lt;/th&gt;&lt;th style=&quot;background-color: #eeeeee; border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;Iterator Methods with Description&lt;/th&gt;&lt;/tr&gt;
&lt;tr style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;1&lt;/td&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;&lt;a href=&quot;http://www.tutorialspoint.com/java/java_using_iterator.htm&quot; style=&quot;background-color: transparent; color: #900b09; margin: 0px; padding: 0px; text-decoration: none;&quot;&gt;Using Java Iterator&lt;/a&gt;&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;Here is a list of all the methods with examples provided by Iterator and ListIterator interfaces.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;h2 style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 1.6em; font-weight: normal; line-height: 1.5em; margin: 0.2em 0.2em 0.2em 0px; padding: 0px; text-shadow: rgb(204, 204, 204) 1px 1px 2px;&quot;&gt;How to use a Comparator ?&lt;/h2&gt;&lt;div style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 12px; margin-bottom: 1em; margin-top: 0.8em; padding: 0px; text-align: justify;&quot;&gt;Both TreeSet and TreeMap store elements in sorted order. However, it is the comparator that defines precisely what&amp;nbsp;&lt;i style=&quot;margin: 0px; padding: 0px;&quot;&gt;sorted order&lt;/i&gt;&amp;nbsp;means.&lt;/div&gt;&lt;div style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 12px; margin-bottom: 1em; margin-top: 0.8em; padding: 0px; text-align: justify;&quot;&gt;This interface lets us sort a given collection any number of different ways. Also this interface can be used to sort any instances of any class (even classes we cannot modify).&lt;/div&gt;&lt;table class=&quot;src&quot; style=&quot;background-color: #f7f7f7; border-collapse: collapse; border: 1px solid rgb(214, 214, 214); color: black; font-family: Helvetica, Arial, sans-serif; font-size: 12px; margin: 8px 0px; padding: 0px; vertical-align: top; width: 560px;&quot;&gt;&lt;tbody style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;tr style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;th style=&quot;background-color: #eeeeee; border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;SN&lt;/th&gt;&lt;th style=&quot;background-color: #eeeeee; border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;Iterator Methods with Description&lt;/th&gt;&lt;/tr&gt;
&lt;tr style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;1&lt;/td&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;&lt;a href=&quot;http://www.tutorialspoint.com/java/java_using_comparator.htm&quot; style=&quot;background-color: transparent; color: #900b09; margin: 0px; padding: 0px; text-decoration: none;&quot;&gt;Using Java Comparator&lt;/a&gt;&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;Here is a list of all the methods with examples provided by Comparator Interface.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;h2 style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 1.6em; font-weight: normal; line-height: 1.5em; margin: 0.2em 0.2em 0.2em 0px; padding: 0px; text-shadow: rgb(204, 204, 204) 1px 1px 2px;&quot;&gt;Summary:&lt;/h2&gt;&lt;div style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 12px; margin-bottom: 1em; margin-top: 0.8em; padding: 0px; text-align: justify;&quot;&gt;The Java collections framework gives the programmer access to prepackaged data structures as well as to algorithms for manipulating them.&lt;/div&gt;&lt;div style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 12px; margin-bottom: 1em; margin-top: 0.8em; padding: 0px; text-align: justify;&quot;&gt;A collection is an object that can hold references to other objects. The collection interfaces declare the operations that can be performed on each type of collection.&lt;/div&gt;&lt;div style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 12px; margin-bottom: 1em; margin-top: 0.8em; padding: 0px; text-align: justify;&quot;&gt;The classes and interfaces of the collections framework are in package java.util.&lt;/div&gt;&lt;br style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 12px; margin: 0px; padding: 0px;&quot; /&gt;&lt;br /&gt;
&lt;br /&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.tutorialspoint.com/java/java_collections.htm#.U8eNAUBNsWo.blogger&quot;&gt;Java Collections Framework Tutorial&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://bridroid.blogspot.com/feeds/8275078858082688621/comments/default' title='댓글'/><link rel='replies' type='text/html' href='http://bridroid.blogspot.com/2014/07/java-collections-framework-tutorial.html#comment-form' title='9개의 덧글'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/905901812770512183/posts/default/8275078858082688621'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/905901812770512183/posts/default/8275078858082688621'/><link rel='alternate' type='text/html' href='http://bridroid.blogspot.com/2014/07/java-collections-framework-tutorial.html' title='Java Collections Framework Tutorial'/><author><name>brith1225</name><uri>http://www.blogger.com/profile/15293023387175369557</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>9</thr:total></entry><entry><id>tag:blogger.com,1999:blog-905901812770512183.post-5120953934010476895</id><published>2014-07-17T01:44:00.001-07:00</published><updated>2014-07-17T01:46:21.665-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="java"/><title type='text'>Java Generics Tutorial</title><content type='html'>&lt;div style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 12px; margin-bottom: 1em; margin-top: 0.8em; padding: 0px; text-align: justify;&quot;&gt;It would be nice if we could write a single sort method that could sort the elements in an Integer array, a String array or an array of any type that supports ordering.&lt;/div&gt;&lt;div style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 12px; margin-bottom: 1em; margin-top: 0.8em; padding: 0px; text-align: justify;&quot;&gt;Java&amp;nbsp;&lt;b style=&quot;margin: 0px; padding: 0px;&quot;&gt;Generic&lt;/b&gt;&amp;nbsp;methods and generic classes enable programmers to specify, with a single method declaration, a set of related methods or, with a single class declaration, a set of related types, respectively.&lt;/div&gt;&lt;div style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 12px; margin-bottom: 1em; margin-top: 0.8em; padding: 0px; text-align: justify;&quot;&gt;Generics also provide compile-time type safety that allows programmers to catch invalid types at compile time.&lt;/div&gt;&lt;div style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 12px; margin-bottom: 1em; margin-top: 0.8em; padding: 0px; text-align: justify;&quot;&gt;Using Java Generic concept, we might write a generic method for sorting an array of objects, then invoke the generic method with Integer arrays, Double arrays, String arrays and so on, to sort the array elements.&lt;/div&gt;&lt;h2 style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 1.6em; font-weight: normal; line-height: 1.5em; margin: 0.2em 0.2em 0.2em 0px; padding: 0px; text-shadow: rgb(204, 204, 204) 1px 1px 2px;&quot;&gt;Generic Methods:&lt;/h2&gt;&lt;div style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 12px; margin-bottom: 1em; margin-top: 0.8em; padding: 0px; text-align: justify;&quot;&gt;You can write a single generic method declaration that can be called with arguments of different types. Based on the types of the arguments passed to the generic method, the compiler handles each method call appropriately. Following are the rules to define Generic Methods:&lt;/div&gt;&lt;ul class=&quot;list&quot; style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 12px; list-style: none; margin: 0px; padding: 0px 0px 0px 15px;&quot;&gt;&lt;li style=&quot;background: url(http://www.tutorialspoint.com/images/icon-bullet.png) 0px 0px no-repeat; margin: 0px; padding: 0px 0px 0px 19px;&quot;&gt;&lt;div style=&quot;margin-bottom: 1em; margin-top: 0.8em; padding: 0px; text-align: justify;&quot;&gt;All generic method declarations have a type parameter section delimited by angle brackets (&amp;lt; and &amp;gt;) that precedes the method&#39;s return type ( &amp;lt; E &amp;gt; in the next example).&lt;/div&gt;&lt;/li&gt;
&lt;li style=&quot;background: url(http://www.tutorialspoint.com/images/icon-bullet.png) 0px 0px no-repeat; margin: 0px; padding: 0px 0px 0px 19px;&quot;&gt;&lt;div style=&quot;margin-bottom: 1em; margin-top: 0.8em; padding: 0px; text-align: justify;&quot;&gt;Each type parameter section contains one or more type parameters separated by commas. A type parameter, also known as a type variable, is an identifier that specifies a generic type name.&lt;/div&gt;&lt;/li&gt;
&lt;li style=&quot;background: url(http://www.tutorialspoint.com/images/icon-bullet.png) 0px 0px no-repeat; margin: 0px; padding: 0px 0px 0px 19px;&quot;&gt;&lt;div style=&quot;margin-bottom: 1em; margin-top: 0.8em; padding: 0px; text-align: justify;&quot;&gt;The type parameters can be used to declare the return type and act as placeholders for the types of the arguments passed to the generic method, which are known as actual type arguments.&lt;/div&gt;&lt;/li&gt;
&lt;li style=&quot;background: url(http://www.tutorialspoint.com/images/icon-bullet.png) 0px 0px no-repeat; margin: 0px; padding: 0px 0px 0px 19px;&quot;&gt;&lt;div style=&quot;margin-bottom: 1em; margin-top: 0.8em; padding: 0px; text-align: justify;&quot;&gt;A generic method&#39;s body is declared like that of any other method. Note that type parameters can represent only reference types, not primitive types (like int, double and char).&lt;/div&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;h2 style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 1.6em; font-weight: normal; line-height: 1.5em; margin: 0.2em 0.2em 0.2em 0px; padding: 0px; text-shadow: rgb(204, 204, 204) 1px 1px 2px;&quot;&gt;Example:&lt;/h2&gt;&lt;div style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 12px; margin-bottom: 1em; margin-top: 0.8em; padding: 0px; text-align: justify;&quot;&gt;Following example illustrates how we can print array of different type using a single Generic method:&lt;/div&gt;&lt;pre class=&quot;prettyprint tryit prettyprinted&quot; style=&quot;background-attachment: initial !important; background-clip: initial !important; background-color: rgb(238, 238, 238) !important; background-image: url(http://www.tutorialspoint.com/images/link.png) !important; background-origin: initial !important; background-position: 100% 0%; background-repeat: no-repeat !important; background-size: initial !important; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; border: 1px solid rgb(214, 214, 214); cursor: default; font-size: 12px; margin-bottom: 10px; overflow: auto; padding: 5px; width: 549.765625px;&quot;&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;public&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;GenericMethodTest&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
   &lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;color: #880000; margin: 0px; padding: 0px;&quot;&gt;// generic method printArray                         &lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
   &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;public&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;static&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; E &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;void&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; printArray&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; E&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;[]&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; inputArray &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
   &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
      &lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;color: #880000; margin: 0px; padding: 0px;&quot;&gt;// Display array elements              &lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
         &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;for&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; E element &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; inputArray &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;){&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;        
            &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;System&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;out&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;printf&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;color: #008800; margin: 0px; padding: 0px;&quot;&gt;&quot;%s &quot;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; element &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
         &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
         &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;System&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;out&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;println&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;

    &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;public&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;static&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;void&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; main&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; args&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;[]&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;color: #880000; margin: 0px; padding: 0px;&quot;&gt;// Create arrays of Integer, Double and Character&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;Integer&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;[]&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; intArray &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666; margin: 0px; padding: 0px;&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666; margin: 0px; padding: 0px;&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666; margin: 0px; padding: 0px;&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666; margin: 0px; padding: 0px;&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666; margin: 0px; padding: 0px;&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;};&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;Double&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;[]&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; doubleArray &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666; margin: 0px; padding: 0px;&quot;&gt;1.1&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666; margin: 0px; padding: 0px;&quot;&gt;2.2&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666; margin: 0px; padding: 0px;&quot;&gt;3.3&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666; margin: 0px; padding: 0px;&quot;&gt;4.4&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;};&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;Character&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;[]&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; charArray &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;color: #008800; margin: 0px; padding: 0px;&quot;&gt;&#39;H&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;color: #008800; margin: 0px; padding: 0px;&quot;&gt;&#39;E&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;color: #008800; margin: 0px; padding: 0px;&quot;&gt;&#39;L&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;color: #008800; margin: 0px; padding: 0px;&quot;&gt;&#39;L&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;color: #008800; margin: 0px; padding: 0px;&quot;&gt;&#39;O&#39;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;};&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;

        &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;System&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;out&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;println&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;color: #008800; margin: 0px; padding: 0px;&quot;&gt;&quot;Array integerArray contains:&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
        printArray&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; intArray  &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;color: #880000; margin: 0px; padding: 0px;&quot;&gt;// pass an Integer array&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;

        &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;System&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;out&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;println&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;color: #008800; margin: 0px; padding: 0px;&quot;&gt;&quot;\nArray doubleArray contains:&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
        printArray&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; doubleArray &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;color: #880000; margin: 0px; padding: 0px;&quot;&gt;// pass a Double array&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;

        &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;System&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;out&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;println&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;color: #008800; margin: 0px; padding: 0px;&quot;&gt;&quot;\nArray characterArray contains:&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
        printArray&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; charArray &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;color: #880000; margin: 0px; padding: 0px;&quot;&gt;// pass a Character array&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; 
&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;&lt;div style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 12px; margin-bottom: 1em; margin-top: 0.8em; padding: 0px; text-align: justify;&quot;&gt;This would produce the following result:&lt;/div&gt;&lt;pre class=&quot;prettyprint prettyprinted&quot; style=&quot;background-color: #eeeeee; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; border: 1px solid rgb(214, 214, 214); font-size: 12px; margin-bottom: 10px; overflow: auto; padding: 5px; width: 549.765625px;&quot;&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;Array&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; integerArray contains&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666; margin: 0px; padding: 0px;&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666; margin: 0px; padding: 0px;&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666; margin: 0px; padding: 0px;&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666; margin: 0px; padding: 0px;&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666; margin: 0px; padding: 0px;&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666; margin: 0px; padding: 0px;&quot;&gt;6&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;

&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;Array&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; doubleArray contains&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666; margin: 0px; padding: 0px;&quot;&gt;1.1&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666; margin: 0px; padding: 0px;&quot;&gt;2.2&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666; margin: 0px; padding: 0px;&quot;&gt;3.3&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666; margin: 0px; padding: 0px;&quot;&gt;4.4&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; 

&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;Array&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; characterArray contains&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
H E L L O&lt;/span&gt;&lt;/pre&gt;&lt;h2 style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 1.6em; font-weight: normal; line-height: 1.5em; margin: 0.2em 0.2em 0.2em 0px; padding: 0px; text-shadow: rgb(204, 204, 204) 1px 1px 2px;&quot;&gt;Bounded Type Parameters:&lt;/h2&gt;&lt;div style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 12px; margin-bottom: 1em; margin-top: 0.8em; padding: 0px; text-align: justify;&quot;&gt;There may be times when you&#39;ll want to restrict the kinds of types that are allowed to be passed to a type parameter. For example, a method that operates on numbers might only want to accept instances of Number or its subclasses. This is what bounded type parameters are for.&lt;/div&gt;&lt;div style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 12px; margin-bottom: 1em; margin-top: 0.8em; padding: 0px; text-align: justify;&quot;&gt;To declare a bounded type parameter, list the type parameter&#39;s name, followed by the extends keyword, followed by its upper bound.&lt;/div&gt;&lt;h2 style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 1.6em; font-weight: normal; line-height: 1.5em; margin: 0.2em 0.2em 0.2em 0px; padding: 0px; text-shadow: rgb(204, 204, 204) 1px 1px 2px;&quot;&gt;Example:&lt;/h2&gt;&lt;div style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 12px; margin-bottom: 1em; margin-top: 0.8em; padding: 0px; text-align: justify;&quot;&gt;Following example illustrates how extends is used in a general sense to mean either &quot;extends&quot; (as in classes) or &quot;implements&quot; (as in interfaces). This example is Generic method to return the largest of three Comparable objects:&lt;/div&gt;&lt;pre class=&quot;prettyprint tryit prettyprinted&quot; style=&quot;background-attachment: initial !important; background-clip: initial !important; background-color: rgb(238, 238, 238) !important; background-image: url(http://www.tutorialspoint.com/images/link.png) !important; background-origin: initial !important; background-position: 100% 0%; background-repeat: no-repeat !important; background-size: initial !important; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; border: 1px solid rgb(214, 214, 214); font-size: 12px; margin-bottom: 10px; overflow: auto; padding: 5px; width: 549.765625px;&quot;&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;public&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;MaximumTest&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
   &lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;color: #880000; margin: 0px; padding: 0px;&quot;&gt;// determines the largest of three Comparable objects&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
   &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;public&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;static&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;T &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;extends&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;Comparable&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;T&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; T maximum&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;T x&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; T y&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; T z&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
   &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;                      
      T max &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; x&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;color: #880000; margin: 0px; padding: 0px;&quot;&gt;// assume x is initially the largest       &lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
      &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; y&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;compareTo&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; max &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666; margin: 0px; padding: 0px;&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;){&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
         max &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; y&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;color: #880000; margin: 0px; padding: 0px;&quot;&gt;// y is the largest so far&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
      &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
      &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; z&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;compareTo&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; max &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666; margin: 0px; padding: 0px;&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;){&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
         max &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; z&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;color: #880000; margin: 0px; padding: 0px;&quot;&gt;// z is the largest now                 &lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
      &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
      &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; max&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;color: #880000; margin: 0px; padding: 0px;&quot;&gt;// returns the largest object   &lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
   &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
   &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;public&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;static&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;void&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; main&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; args&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;[]&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
   &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
      &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;System&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;out&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;printf&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;color: #008800; margin: 0px; padding: 0px;&quot;&gt;&quot;Max of %d, %d and %d is %d\n\n&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; 
                   &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666; margin: 0px; padding: 0px;&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666; margin: 0px; padding: 0px;&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666; margin: 0px; padding: 0px;&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; maximum&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666; margin: 0px; padding: 0px;&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666; margin: 0px; padding: 0px;&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666; margin: 0px; padding: 0px;&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;

      &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;System&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;out&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;printf&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;color: #008800; margin: 0px; padding: 0px;&quot;&gt;&quot;Maxm of %.1f,%.1f and %.1f is %.1f\n\n&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
                   &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666; margin: 0px; padding: 0px;&quot;&gt;6.6&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666; margin: 0px; padding: 0px;&quot;&gt;8.8&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666; margin: 0px; padding: 0px;&quot;&gt;7.7&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; maximum&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666; margin: 0px; padding: 0px;&quot;&gt;6.6&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666; margin: 0px; padding: 0px;&quot;&gt;8.8&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666; margin: 0px; padding: 0px;&quot;&gt;7.7&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;

      &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;System&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;out&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;printf&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;color: #008800; margin: 0px; padding: 0px;&quot;&gt;&quot;Max of %s, %s and %s is %s\n&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;color: #008800; margin: 0px; padding: 0px;&quot;&gt;&quot;pear&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
         &lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;color: #008800; margin: 0px; padding: 0px;&quot;&gt;&quot;apple&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;color: #008800; margin: 0px; padding: 0px;&quot;&gt;&quot;orange&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; maximum&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;color: #008800; margin: 0px; padding: 0px;&quot;&gt;&quot;pear&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;color: #008800; margin: 0px; padding: 0px;&quot;&gt;&quot;apple&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;color: #008800; margin: 0px; padding: 0px;&quot;&gt;&quot;orange&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
   &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;&lt;div style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 12px; margin-bottom: 1em; margin-top: 0.8em; padding: 0px; text-align: justify;&quot;&gt;This would produce the following result:&lt;/div&gt;&lt;pre class=&quot;prettyprint prettyprinted&quot; style=&quot;background-color: #eeeeee; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; border: 1px solid rgb(214, 214, 214); font-size: 12px; margin-bottom: 10px; overflow: auto; padding: 5px; width: 549.765625px;&quot;&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;Maximum&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; of &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666; margin: 0px; padding: 0px;&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666; margin: 0px; padding: 0px;&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;and&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666; margin: 0px; padding: 0px;&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;is&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666; margin: 0px; padding: 0px;&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;

&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;Maximum&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; of &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666; margin: 0px; padding: 0px;&quot;&gt;6.6&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666; margin: 0px; padding: 0px;&quot;&gt;8.8&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;and&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666; margin: 0px; padding: 0px;&quot;&gt;7.7&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;is&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666; margin: 0px; padding: 0px;&quot;&gt;8.8&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;

&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;Maximum&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; of pear&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; apple &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;and&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; orange &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;is&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; pear&lt;/span&gt;&lt;/pre&gt;&lt;h2 style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 1.6em; font-weight: normal; line-height: 1.5em; margin: 0.2em 0.2em 0.2em 0px; padding: 0px; text-shadow: rgb(204, 204, 204) 1px 1px 2px;&quot;&gt;Generic Classes:&lt;/h2&gt;&lt;div style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 12px; margin-bottom: 1em; margin-top: 0.8em; padding: 0px; text-align: justify;&quot;&gt;A generic class declaration looks like a non-generic class declaration, except that the class name is followed by a type parameter section.&lt;/div&gt;&lt;div style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 12px; margin-bottom: 1em; margin-top: 0.8em; padding: 0px; text-align: justify;&quot;&gt;As with generic methods, the type parameter section of a generic class can have one or more type parameters separated by commas. These classes are known as parameterized classes or parameterized types because they accept one or more parameters.&lt;/div&gt;&lt;h2 style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 1.6em; font-weight: normal; line-height: 1.5em; margin: 0.2em 0.2em 0.2em 0px; padding: 0px; text-shadow: rgb(204, 204, 204) 1px 1px 2px;&quot;&gt;Example:&lt;/h2&gt;&lt;div style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 12px; margin-bottom: 1em; margin-top: 0.8em; padding: 0px; text-align: justify;&quot;&gt;Following example illustrates how we can define a generic class:&lt;/div&gt;&lt;pre class=&quot;prettyprint tryit prettyprinted&quot; style=&quot;background-attachment: initial !important; background-clip: initial !important; background-color: rgb(238, 238, 238) !important; background-image: url(http://www.tutorialspoint.com/images/link.png) !important; background-origin: initial !important; background-position: 100% 0%; background-repeat: no-repeat !important; background-size: initial !important; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; border: 1px solid rgb(214, 214, 214); font-size: 12px; margin-bottom: 10px; overflow: auto; padding: 5px; width: 549.765625px;&quot;&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;public&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;Box&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;T&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;

  &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;private&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; T t&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;

  &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;public&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;void&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; add&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;T t&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;t &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; t&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;

  &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;public&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; T &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;get&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; t&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;

  &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;public&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;static&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;void&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; main&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;[]&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; args&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
     &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;Box&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;Integer&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; integerBox &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;Box&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;Integer&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;&amp;gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
     &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;Box&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; stringBox &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;Box&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;&amp;gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
    
     integerBox&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;add&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;Integer&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666; margin: 0px; padding: 0px;&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;));&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
     stringBox&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;add&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;color: #008800; margin: 0px; padding: 0px;&quot;&gt;&quot;Hello World&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;));&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;

     &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;System&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;out&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;printf&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;color: #008800; margin: 0px; padding: 0px;&quot;&gt;&quot;Integer Value :%d\n\n&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; integerBox&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;get&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;());&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
     &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;System&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;out&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;printf&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;color: #008800; margin: 0px; padding: 0px;&quot;&gt;&quot;String Value :%s\n&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; stringBox&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;get&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;());&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;&lt;div style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 12px; margin-bottom: 1em; margin-top: 0.8em; padding: 0px; text-align: justify;&quot;&gt;This would produce the following result:&lt;/div&gt;&lt;pre class=&quot;prettyprint prettyprinted&quot; style=&quot;background-color: #eeeeee; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; border: 1px solid rgb(214, 214, 214); font-size: 12px; margin-bottom: 10px; overflow: auto; padding: 5px; width: 549.765625px;&quot;&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;Integer&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;Value&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666; margin: 0px; padding: 0px;&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;

&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;Value&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;Hello&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;World&lt;/span&gt;&lt;/pre&gt;&lt;div&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.tutorialspoint.com/java/java_generics.htm#.U8eM4MzyUxI.blogger&quot;&gt;Java Generics Tutorial&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://bridroid.blogspot.com/feeds/5120953934010476895/comments/default' title='댓글'/><link rel='replies' type='text/html' href='http://bridroid.blogspot.com/2014/07/java-generics-tutorial.html#comment-form' title='0개의 덧글'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/905901812770512183/posts/default/5120953934010476895'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/905901812770512183/posts/default/5120953934010476895'/><link rel='alternate' type='text/html' href='http://bridroid.blogspot.com/2014/07/java-generics-tutorial.html' title='Java Generics Tutorial'/><author><name>brith1225</name><uri>http://www.blogger.com/profile/15293023387175369557</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-905901812770512183.post-5589824452615090017</id><published>2014-07-17T01:41:00.001-07:00</published><updated>2014-07-17T01:42:03.560-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="java"/><title type='text'>Java - Networking (Socket Programming) Tutorial</title><content type='html'>&lt;div style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 12px; margin-bottom: 1em; margin-top: 0.8em; padding: 0px; text-align: justify;&quot;&gt;The term&amp;nbsp;&lt;i style=&quot;margin: 0px; padding: 0px;&quot;&gt;network programming&lt;/i&gt;&amp;nbsp;refers to writing programs that execute across multiple devices (computers), in which the devices are all connected to each other using a network.&lt;/div&gt;&lt;div style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 12px; margin-bottom: 1em; margin-top: 0.8em; padding: 0px; text-align: justify;&quot;&gt;The java.net package of the J2SE APIs contains a collection of classes and interfaces that provide the low-level communication details, allowing you to write programs that focus on solving the problem at hand.&lt;/div&gt;&lt;div style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 12px; margin-bottom: 1em; margin-top: 0.8em; padding: 0px; text-align: justify;&quot;&gt;The java.net package provides support for the two common network protocols:&lt;/div&gt;&lt;ul class=&quot;list&quot; style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 12px; list-style: none; margin: 0px; padding: 0px 0px 0px 15px;&quot;&gt;&lt;li style=&quot;background: url(http://www.tutorialspoint.com/images/icon-bullet.png) 0px 0px no-repeat; margin: 0px; padding: 0px 0px 0px 19px;&quot;&gt;&lt;div style=&quot;margin-bottom: 1em; margin-top: 0.8em; padding: 0px; text-align: justify;&quot;&gt;&lt;b style=&quot;margin: 0px; padding: 0px;&quot;&gt;TCP:&lt;/b&gt;&amp;nbsp;TCP stands for Transmission Control Protocol, which allows for reliable communication between two applications. TCP is typically used over the Internet Protocol, which is referred to as TCP/IP.&lt;/div&gt;&lt;/li&gt;
&lt;li style=&quot;background: url(http://www.tutorialspoint.com/images/icon-bullet.png) 0px 0px no-repeat; margin: 0px; padding: 0px 0px 0px 19px;&quot;&gt;&lt;div style=&quot;margin-bottom: 1em; margin-top: 0.8em; padding: 0px; text-align: justify;&quot;&gt;&lt;b style=&quot;margin: 0px; padding: 0px;&quot;&gt;UDP:&lt;/b&gt;&amp;nbsp;UDP stands for User Datagram Protocol, a connection-less protocol that allows for packets of data to be transmitted between applications.&lt;/div&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;div style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 12px; margin-bottom: 1em; margin-top: 0.8em; padding: 0px; text-align: justify;&quot;&gt;This tutorial gives good understanding on the following two subjects:&lt;/div&gt;&lt;ul class=&quot;list&quot; style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 12px; list-style: none; margin: 0px; padding: 0px 0px 0px 15px;&quot;&gt;&lt;li style=&quot;background: url(http://www.tutorialspoint.com/images/icon-bullet.png) 0px 0px no-repeat; margin: 0px; padding: 0px 0px 0px 19px;&quot;&gt;&lt;div style=&quot;margin-bottom: 1em; margin-top: 0.8em; padding: 0px; text-align: justify;&quot;&gt;&lt;b style=&quot;margin: 0px; padding: 0px;&quot;&gt;Socket Programming&lt;/b&gt;: This is most widely used concept in Networking and it has been explained in very detail.&lt;/div&gt;&lt;/li&gt;
&lt;li style=&quot;background: url(http://www.tutorialspoint.com/images/icon-bullet.png) 0px 0px no-repeat; margin: 0px; padding: 0px 0px 0px 19px;&quot;&gt;&lt;div style=&quot;margin-bottom: 1em; margin-top: 0.8em; padding: 0px; text-align: justify;&quot;&gt;&lt;b style=&quot;margin: 0px; padding: 0px;&quot;&gt;URL Processing&lt;/b&gt;: This would be covered separately. Click here to learn about&amp;nbsp;&lt;a href=&quot;http://www.tutorialspoint.com/java/java_url_processing.htm&quot; style=&quot;background-color: transparent; color: #900b09; margin: 0px; padding: 0px; text-decoration: none;&quot; title=&quot;URL Processing&quot;&gt;URL Processing&lt;/a&gt;&amp;nbsp;in Java language.&lt;/div&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;h2 style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 1.6em; font-weight: normal; line-height: 1.5em; margin: 0.2em 0.2em 0.2em 0px; padding: 0px; text-shadow: rgb(204, 204, 204) 1px 1px 2px;&quot;&gt;Socket Programming:&lt;/h2&gt;&lt;div style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 12px; margin-bottom: 1em; margin-top: 0.8em; padding: 0px; text-align: justify;&quot;&gt;Sockets provide the communication mechanism between two computers using TCP. A client program creates a socket on its end of the communication and attempts to connect that socket to a server.&lt;/div&gt;&lt;div style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 12px; margin-bottom: 1em; margin-top: 0.8em; padding: 0px; text-align: justify;&quot;&gt;When the connection is made, the server creates a socket object on its end of the communication. The client and server can now communicate by writing to and reading from the socket.&lt;/div&gt;&lt;div style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 12px; margin-bottom: 1em; margin-top: 0.8em; padding: 0px; text-align: justify;&quot;&gt;The java.net.Socket class represents a socket, and the java.net.ServerSocket class provides a mechanism for the server program to listen for clients and establish connections with them.&lt;/div&gt;&lt;div style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 12px; margin-bottom: 1em; margin-top: 0.8em; padding: 0px; text-align: justify;&quot;&gt;The following steps occur when establishing a TCP connection between two computers using sockets:&lt;/div&gt;&lt;ul class=&quot;list&quot; style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 12px; list-style: none; margin: 0px; padding: 0px 0px 0px 15px;&quot;&gt;&lt;li style=&quot;background: url(http://www.tutorialspoint.com/images/icon-bullet.png) 0px 0px no-repeat; margin: 0px; padding: 0px 0px 0px 19px;&quot;&gt;&lt;div style=&quot;margin-bottom: 1em; margin-top: 0.8em; padding: 0px; text-align: justify;&quot;&gt;The server instantiates a ServerSocket object, denoting which port number communication is to occur on.&lt;/div&gt;&lt;/li&gt;
&lt;li style=&quot;background: url(http://www.tutorialspoint.com/images/icon-bullet.png) 0px 0px no-repeat; margin: 0px; padding: 0px 0px 0px 19px;&quot;&gt;&lt;div style=&quot;margin-bottom: 1em; margin-top: 0.8em; padding: 0px; text-align: justify;&quot;&gt;The server invokes the accept() method of the ServerSocket class. This method waits until a client connects to the server on the given port.&lt;/div&gt;&lt;/li&gt;
&lt;li style=&quot;background: url(http://www.tutorialspoint.com/images/icon-bullet.png) 0px 0px no-repeat; margin: 0px; padding: 0px 0px 0px 19px;&quot;&gt;&lt;div style=&quot;margin-bottom: 1em; margin-top: 0.8em; padding: 0px; text-align: justify;&quot;&gt;After the server is waiting, a client instantiates a Socket object, specifying the server name and port number to connect to.&lt;/div&gt;&lt;/li&gt;
&lt;li style=&quot;background: url(http://www.tutorialspoint.com/images/icon-bullet.png) 0px 0px no-repeat; margin: 0px; padding: 0px 0px 0px 19px;&quot;&gt;&lt;div style=&quot;margin-bottom: 1em; margin-top: 0.8em; padding: 0px; text-align: justify;&quot;&gt;The constructor of the Socket class attempts to connect the client to the specified server and port number. If communication is established, the client now has a Socket object capable of communicating with the server.&lt;/div&gt;&lt;/li&gt;
&lt;li style=&quot;background: url(http://www.tutorialspoint.com/images/icon-bullet.png) 0px 0px no-repeat; margin: 0px; padding: 0px 0px 0px 19px;&quot;&gt;&lt;div style=&quot;margin-bottom: 1em; margin-top: 0.8em; padding: 0px; text-align: justify;&quot;&gt;On the server side, the accept() method returns a reference to a new socket on the server that is connected to the client&#39;s socket.&lt;/div&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;div style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 12px; margin-bottom: 1em; margin-top: 0.8em; padding: 0px; text-align: justify;&quot;&gt;After the connections are established, communication can occur using I/O streams. Each socket has both an OutputStream and an InputStream. The client&#39;s OutputStream is connected to the server&#39;s InputStream, and the client&#39;s InputStream is connected to the server&#39;s OutputStream.&lt;/div&gt;&lt;div style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 12px; margin-bottom: 1em; margin-top: 0.8em; padding: 0px; text-align: justify;&quot;&gt;TCP is a twoway communication protocol, so data can be sent across both streams at the same time. There are following usefull classes providing complete set of methods to implement sockets.&lt;/div&gt;&lt;h2 style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 1.6em; font-weight: normal; line-height: 1.5em; margin: 0.2em 0.2em 0.2em 0px; padding: 0px; text-shadow: rgb(204, 204, 204) 1px 1px 2px;&quot;&gt;ServerSocket Class Methods:&lt;/h2&gt;&lt;div style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 12px; margin-bottom: 1em; margin-top: 0.8em; padding: 0px; text-align: justify;&quot;&gt;The&amp;nbsp;&lt;b style=&quot;margin: 0px; padding: 0px;&quot;&gt;java.net.ServerSocket&lt;/b&gt;&amp;nbsp;class is used by server applications to obtain a port and listen for client requests&lt;/div&gt;&lt;div style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 12px; margin-bottom: 1em; margin-top: 0.8em; padding: 0px; text-align: justify;&quot;&gt;The ServerSocket class has four constructors:&lt;/div&gt;&lt;table class=&quot;src&quot; style=&quot;background-color: #f7f7f7; border-collapse: collapse; border: 1px solid rgb(214, 214, 214); color: black; font-family: Helvetica, Arial, sans-serif; font-size: 12px; margin: 8px 0px; padding: 0px; vertical-align: top; width: 560px;&quot;&gt;&lt;tbody style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;tr style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;th style=&quot;background-color: #eeeeee; border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;SN&lt;/th&gt;&lt;th style=&quot;background-color: #eeeeee; border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;Methods with Description&lt;/th&gt;&lt;/tr&gt;
&lt;tr style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;1&lt;/td&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;&lt;b style=&quot;margin: 0px; padding: 0px;&quot;&gt;public ServerSocket(int port) throws IOException&lt;/b&gt;&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;Attempts to create a server socket bound to the specified port. An exception occurs if the port is already bound by another application.&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;2&lt;/td&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;&lt;b style=&quot;margin: 0px; padding: 0px;&quot;&gt;public ServerSocket(int port, int backlog) throws IOException&lt;/b&gt;&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;Similar to the previous constructor, the backlog parameter specifies how many incoming clients to store in a wait queue.&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;3&lt;/td&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;&lt;b style=&quot;margin: 0px; padding: 0px;&quot;&gt;public ServerSocket(int port, int backlog, InetAddress address) throws IOException&lt;/b&gt;&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;Similar to the previous constructor, the InetAddress parameter specifies the local IP address to bind to. The InetAddress is used for servers that may have multiple IP addresses, allowing the server to specify which of its IP addresses to accept client requests on&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;4&lt;/td&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;&lt;b style=&quot;margin: 0px; padding: 0px;&quot;&gt;public ServerSocket() throws IOException&lt;/b&gt;&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;Creates an unbound server socket. When using this constructor, use the bind() method when you are ready to bind the server socket&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;div style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 12px; margin-bottom: 1em; margin-top: 0.8em; padding: 0px; text-align: justify;&quot;&gt;If the ServerSocket constructor does not throw an exception, it means that your application has successfully bound to the specified port and is ready for client requests.&lt;/div&gt;&lt;div style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 12px; margin-bottom: 1em; margin-top: 0.8em; padding: 0px; text-align: justify;&quot;&gt;Here are some of the common methods of the ServerSocket class:&lt;/div&gt;&lt;table class=&quot;src&quot; style=&quot;background-color: #f7f7f7; border-collapse: collapse; border: 1px solid rgb(214, 214, 214); color: black; font-family: Helvetica, Arial, sans-serif; font-size: 12px; margin: 8px 0px; padding: 0px; vertical-align: top; width: 560px;&quot;&gt;&lt;tbody style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;tr style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;th style=&quot;background-color: #eeeeee; border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;SN&lt;/th&gt;&lt;th style=&quot;background-color: #eeeeee; border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;Methods with Description&lt;/th&gt;&lt;/tr&gt;
&lt;tr style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;1&lt;/td&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;&lt;b style=&quot;margin: 0px; padding: 0px;&quot;&gt;public int getLocalPort()&lt;/b&gt;&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;Returns the port that the server socket is listening on. This method is useful if you passed in 0 as the port number in a constructor and let the server find a port for you.&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;2&lt;/td&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;&lt;b style=&quot;margin: 0px; padding: 0px;&quot;&gt;public Socket accept() throws IOException&lt;/b&gt;&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;Waits for an incoming client. This method blocks until either a client connects to the server on the specified port or the socket times out, assuming that the time-out value has been set using the setSoTimeout() method. Otherwise, this method blocks indefinitely&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;3&lt;/td&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;&lt;b style=&quot;margin: 0px; padding: 0px;&quot;&gt;public void setSoTimeout(int timeout)&lt;/b&gt;&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;Sets the time-out value for how long the server socket waits for a client during the accept().&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;4&lt;/td&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;&lt;b style=&quot;margin: 0px; padding: 0px;&quot;&gt;public void bind(SocketAddress host, int backlog)&lt;/b&gt;&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;Binds the socket to the specified server and port in the SocketAddress object. Use this method if you instantiated the ServerSocket using the no-argument constructor.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;div style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 12px; margin-bottom: 1em; margin-top: 0.8em; padding: 0px; text-align: justify;&quot;&gt;When the ServerSocket invokes accept(), the method does not return until a client connects. After a client does connect, the ServerSocket creates a new Socket on an unspecified port and returns a reference to this new Socket. A TCP connection now exists between the client and server, and communication can begin.&lt;/div&gt;&lt;h2 style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 1.6em; font-weight: normal; line-height: 1.5em; margin: 0.2em 0.2em 0.2em 0px; padding: 0px; text-shadow: rgb(204, 204, 204) 1px 1px 2px;&quot;&gt;Socket Class Methods:&lt;/h2&gt;&lt;div style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 12px; margin-bottom: 1em; margin-top: 0.8em; padding: 0px; text-align: justify;&quot;&gt;The&amp;nbsp;&lt;b style=&quot;margin: 0px; padding: 0px;&quot;&gt;java.net.Socket&lt;/b&gt;&amp;nbsp;class represents the socket that both the client and server use to communicate with each other. The client obtains a Socket object by instantiating one, whereas the server obtains a Socket object from the return value of the accept() method.&lt;/div&gt;&lt;div style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 12px; margin-bottom: 1em; margin-top: 0.8em; padding: 0px; text-align: justify;&quot;&gt;The Socket class has five constructors that a client uses to connect to a server:&lt;/div&gt;&lt;table class=&quot;src&quot; style=&quot;background-color: #f7f7f7; border-collapse: collapse; border: 1px solid rgb(214, 214, 214); color: black; font-family: Helvetica, Arial, sans-serif; font-size: 12px; margin: 8px 0px; padding: 0px; vertical-align: top; width: 560px;&quot;&gt;&lt;tbody style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;tr style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;th style=&quot;background-color: #eeeeee; border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;SN&lt;/th&gt;&lt;th style=&quot;background-color: #eeeeee; border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;Methods with Description&lt;/th&gt;&lt;/tr&gt;
&lt;tr style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;1&lt;/td&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;&lt;b style=&quot;margin: 0px; padding: 0px;&quot;&gt;public Socket(String host, int port) throws UnknownHostException, IOException.&lt;/b&gt;&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;This method attempts to connect to the specified server at the specified port. If this constructor does not throw an exception, the connection is successful and the client is connected to the server.&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;2&lt;/td&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;&lt;b style=&quot;margin: 0px; padding: 0px;&quot;&gt;public Socket(InetAddress host, int port) throws IOException&lt;/b&gt;&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;This method is identical to the previous constructor, except that the host is denoted by an InetAddress object.&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;3&lt;/td&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;&lt;b style=&quot;margin: 0px; padding: 0px;&quot;&gt;public Socket(String host, int port, InetAddress localAddress, int localPort) throws IOException.&lt;/b&gt;&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;Connects to the specified host and port, creating a socket on the local host at the specified address and port.&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;4&lt;/td&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;&lt;b style=&quot;margin: 0px; padding: 0px;&quot;&gt;public Socket(InetAddress host, int port, InetAddress localAddress, int localPort) throws IOException.&lt;/b&gt;&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;This method is identical to the previous constructor, except that the host is denoted by an InetAddress object instead of a String&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;5&lt;/td&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;&lt;b style=&quot;margin: 0px; padding: 0px;&quot;&gt;public Socket()&lt;/b&gt;&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;Creates an unconnected socket. Use the connect() method to connect this socket to a server.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;div style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 12px; margin-bottom: 1em; margin-top: 0.8em; padding: 0px; text-align: justify;&quot;&gt;When the Socket constructor returns, it does not simply instantiate a Socket object but it actually attempts to connect to the specified server and port.&lt;/div&gt;&lt;div style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 12px; margin-bottom: 1em; margin-top: 0.8em; padding: 0px; text-align: justify;&quot;&gt;Some methods of interest in the Socket class are listed here. Notice that both the client and server have a Socket object, so these methods can be invoked by both the client and server.&lt;/div&gt;&lt;table class=&quot;src&quot; style=&quot;background-color: #f7f7f7; border-collapse: collapse; border: 1px solid rgb(214, 214, 214); color: black; font-family: Helvetica, Arial, sans-serif; font-size: 12px; margin: 8px 0px; padding: 0px; vertical-align: top; width: 560px;&quot;&gt;&lt;tbody style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;tr style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;th style=&quot;background-color: #eeeeee; border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;SN&lt;/th&gt;&lt;th style=&quot;background-color: #eeeeee; border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;Methods with Description&lt;/th&gt;&lt;/tr&gt;
&lt;tr style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;1&lt;/td&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;&lt;b style=&quot;margin: 0px; padding: 0px;&quot;&gt;public void connect(SocketAddress host, int timeout) throws IOException&lt;/b&gt;&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;This method connects the socket to the specified host. This method is needed only when you instantiated the Socket using the no-argument constructor.&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;2&lt;/td&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;&lt;b style=&quot;margin: 0px; padding: 0px;&quot;&gt;public InetAddress getInetAddress()&lt;/b&gt;&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;This method returns the address of the other computer that this socket is connected to.&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;3&lt;/td&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;&lt;b style=&quot;margin: 0px; padding: 0px;&quot;&gt;public int getPort()&lt;/b&gt;&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;Returns the port the socket is bound to on the remote machine.&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;4&lt;/td&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;&lt;b style=&quot;margin: 0px; padding: 0px;&quot;&gt;public int getLocalPort()&lt;/b&gt;&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;Returns the port the socket is bound to on the local machine.&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;5&lt;/td&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;&lt;b style=&quot;margin: 0px; padding: 0px;&quot;&gt;public SocketAddress getRemoteSocketAddress()&lt;/b&gt;&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;Returns the address of the remote socket.&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;6&lt;/td&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;&lt;b style=&quot;margin: 0px; padding: 0px;&quot;&gt;public InputStream getInputStream() throws IOException&lt;/b&gt;&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;Returns the input stream of the socket. The input stream is connected to the output stream of the remote socket.&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;7&lt;/td&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;&lt;b style=&quot;margin: 0px; padding: 0px;&quot;&gt;public OutputStream getOutputStream() throws IOException&lt;/b&gt;&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;Returns the output stream of the socket. The output stream is connected to the input stream of the remote socket&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;8&lt;/td&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;&lt;b style=&quot;margin: 0px; padding: 0px;&quot;&gt;public void close() throws IOException&lt;/b&gt;&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;Closes the socket, which makes this Socket object no longer capable of connecting again to any server&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;h2 style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 1.6em; font-weight: normal; line-height: 1.5em; margin: 0.2em 0.2em 0.2em 0px; padding: 0px; text-shadow: rgb(204, 204, 204) 1px 1px 2px;&quot;&gt;InetAddress Class Methods:&lt;/h2&gt;&lt;div style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 12px; margin-bottom: 1em; margin-top: 0.8em; padding: 0px; text-align: justify;&quot;&gt;This class represents an Internet Protocol (IP) address. Here are following usefull methods which you would need while doing socket programming:&lt;/div&gt;&lt;table class=&quot;src&quot; style=&quot;background-color: #f7f7f7; border-collapse: collapse; border: 1px solid rgb(214, 214, 214); color: black; font-family: Helvetica, Arial, sans-serif; font-size: 12px; margin: 8px 0px; padding: 0px; vertical-align: top; width: 560px;&quot;&gt;&lt;tbody style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;tr style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;th style=&quot;background-color: #eeeeee; border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;SN&lt;/th&gt;&lt;th style=&quot;background-color: #eeeeee; border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;Methods with Description&lt;/th&gt;&lt;/tr&gt;
&lt;tr style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;1&lt;/td&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;&lt;b style=&quot;margin: 0px; padding: 0px;&quot;&gt;static InetAddress getByAddress(byte[] addr)&lt;/b&gt;&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;Returns an InetAddress object given the raw IP address .&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;2&lt;/td&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;&lt;b style=&quot;margin: 0px; padding: 0px;&quot;&gt;static InetAddress getByAddress(String host, byte[] addr)&lt;/b&gt;&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;Create an InetAddress based on the provided host name and IP address.&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;3&lt;/td&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;&lt;b style=&quot;margin: 0px; padding: 0px;&quot;&gt;static InetAddress getByName(String host)&lt;/b&gt;&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;Determines the IP address of a host, given the host&#39;s name.&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;4&lt;/td&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;&lt;b style=&quot;margin: 0px; padding: 0px;&quot;&gt;String getHostAddress()&amp;nbsp;&lt;/b&gt;&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;Returns the IP address string in textual presentation.&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;5&lt;/td&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;&lt;b style=&quot;margin: 0px; padding: 0px;&quot;&gt;String getHostName()&amp;nbsp;&lt;/b&gt;&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;Gets the host name for this IP address.&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;6&lt;/td&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;&lt;b style=&quot;margin: 0px; padding: 0px;&quot;&gt;static InetAddress InetAddress getLocalHost()&lt;/b&gt;&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;Returns the local host.&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;7&lt;/td&gt;&lt;td style=&quot;border-collapse: collapse; border: 1px solid rgb(214, 214, 214); margin: 0px; padding: 5px;&quot;&gt;&lt;b style=&quot;margin: 0px; padding: 0px;&quot;&gt;String toString()&lt;/b&gt;&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;Converts this IP address to a String.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;h2 style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 1.6em; font-weight: normal; line-height: 1.5em; margin: 0.2em 0.2em 0.2em 0px; padding: 0px; text-shadow: rgb(204, 204, 204) 1px 1px 2px;&quot;&gt;Socket Client Example:&lt;/h2&gt;&lt;div style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 12px; margin-bottom: 1em; margin-top: 0.8em; padding: 0px; text-align: justify;&quot;&gt;The following GreetingClient is a client program that connects to a server by using a socket and sends a greeting, and then waits for a response.&lt;/div&gt;&lt;pre class=&quot;prettyprint prettyprinted&quot; style=&quot;background-color: #eeeeee; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; border: 1px solid rgb(214, 214, 214); font-size: 12px; margin-bottom: 10px; overflow: auto; padding: 5px; width: 549.765625px;&quot;&gt;&lt;span class=&quot;com&quot; style=&quot;color: #880000; margin: 0px; padding: 0px;&quot;&gt;// File Name GreetingClient.java&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;

&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;import&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; java&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;net&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.*;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;import&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; java&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;io&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.*;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;

&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;public&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;GreetingClient&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
   &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;public&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;static&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;void&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; main&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;[]&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; args&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
   &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
      &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; serverName &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; args&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666; margin: 0px; padding: 0px;&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;];&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
      &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;int&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; port &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;Integer&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;parseInt&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;args&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666; margin: 0px; padding: 0px;&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;]);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
      &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;try&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
      &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
         &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;System&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;out&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;println&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;color: #008800; margin: 0px; padding: 0px;&quot;&gt;&quot;Connecting to &quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; serverName
                             &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;color: #008800; margin: 0px; padding: 0px;&quot;&gt;&quot; on port &quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; port&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
         &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;Socket&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; client &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;Socket&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;serverName&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; port&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
         &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;System&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;out&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;println&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;color: #008800; margin: 0px; padding: 0px;&quot;&gt;&quot;Just connected to &quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
                      &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; client&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;getRemoteSocketAddress&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;());&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
         &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;OutputStream&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; outToServer &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; client&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;getOutputStream&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
         &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;DataOutputStream&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;out&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
                       &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;DataOutputStream&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;outToServer&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;

         &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;out&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;writeUTF&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;color: #008800; margin: 0px; padding: 0px;&quot;&gt;&quot;Hello from &quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
                      &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; client&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;getLocalSocketAddress&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;());&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
         &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;InputStream&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; inFromServer &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; client&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;getInputStream&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
         &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;DataInputStream&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;in&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
                        &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;DataInputStream&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;inFromServer&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
         &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;System&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;out&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;println&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;color: #008800; margin: 0px; padding: 0px;&quot;&gt;&quot;Server says &quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;in&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;readUTF&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;());&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
         client&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;close&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
      &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;catch&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;IOException&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; e&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
      &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
         e&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;printStackTrace&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
      &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
   &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;&lt;h2 style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 1.6em; font-weight: normal; line-height: 1.5em; margin: 0.2em 0.2em 0.2em 0px; padding: 0px; text-shadow: rgb(204, 204, 204) 1px 1px 2px;&quot;&gt;Socket Server Example:&lt;/h2&gt;&lt;div style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 12px; margin-bottom: 1em; margin-top: 0.8em; padding: 0px; text-align: justify;&quot;&gt;The following GreetingServer program is an example of a server application that uses the Socket class to listen for clients on a port number specified by a command-line argument:&lt;/div&gt;&lt;pre class=&quot;prettyprint prettyprinted&quot; style=&quot;background-color: #eeeeee; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; border: 1px solid rgb(214, 214, 214); font-size: 12px; margin-bottom: 10px; overflow: auto; padding: 5px; width: 549.765625px;&quot;&gt;&lt;span class=&quot;com&quot; style=&quot;color: #880000; margin: 0px; padding: 0px;&quot;&gt;// File Name GreetingServer.java&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;

&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;import&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; java&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;net&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.*;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;import&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; java&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;io&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.*;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;

&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;public&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;GreetingServer&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;extends&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;Thread&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
   &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;private&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;ServerSocket&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; serverSocket&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
   
   &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;public&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;GreetingServer&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;int&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; port&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;throws&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;IOException&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
   &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
      serverSocket &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;ServerSocket&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;port&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
      serverSocket&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;setSoTimeout&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666; margin: 0px; padding: 0px;&quot;&gt;10000&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
   &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;

   &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;public&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;void&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; run&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
   &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
      &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;while&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
      &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
         &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;try&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
         &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
            &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;System&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;out&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;println&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;color: #008800; margin: 0px; padding: 0px;&quot;&gt;&quot;Waiting for client on port &quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
            serverSocket&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;getLocalPort&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;color: #008800; margin: 0px; padding: 0px;&quot;&gt;&quot;...&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
            &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;Socket&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; server &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; serverSocket&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;accept&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
            &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;System&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;out&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;println&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;color: #008800; margin: 0px; padding: 0px;&quot;&gt;&quot;Just connected to &quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
                  &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; server&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;getRemoteSocketAddress&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;());&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
            &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;DataInputStream&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;in&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
                  &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;DataInputStream&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;server&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;getInputStream&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;());&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
            &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;System&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;out&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;println&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;in&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;readUTF&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;());&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
            &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;DataOutputStream&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;out&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
                 &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;DataOutputStream&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;server&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;getOutputStream&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;());&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
            &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;out&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;writeUTF&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;color: #008800; margin: 0px; padding: 0px;&quot;&gt;&quot;Thank you for connecting to &quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
              &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; server&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;getLocalSocketAddress&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;color: #008800; margin: 0px; padding: 0px;&quot;&gt;&quot;\nGoodbye!&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
            server&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;close&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
         &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;catch&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;SocketTimeoutException&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; s&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
         &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
            &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;System&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;out&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;println&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;color: #008800; margin: 0px; padding: 0px;&quot;&gt;&quot;Socket timed out!&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
            &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;break&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
         &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;catch&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;IOException&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; e&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
         &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
            e&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;printStackTrace&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
            &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;break&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
         &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
      &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
   &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
   &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;public&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;static&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;void&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; main&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;[]&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; args&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
   &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
      &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;int&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; port &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;Integer&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;parseInt&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;args&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666; margin: 0px; padding: 0px;&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;]);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
      &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;try&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
      &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
         &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;Thread&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; t &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;GreetingServer&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;port&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
         t&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;start&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
      &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;catch&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;IOException&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; e&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
      &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
         e&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;printStackTrace&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
      &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
   &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;&lt;div style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 12px; margin-bottom: 1em; margin-top: 0.8em; padding: 0px; text-align: justify;&quot;&gt;Compile client and server and then start server as follows:&lt;/div&gt;&lt;pre class=&quot;prettyprint prettyprinted&quot; style=&quot;background-color: #eeeeee; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; border: 1px solid rgb(214, 214, 214); font-size: 12px; margin-bottom: 10px; overflow: auto; padding: 5px; width: 549.765625px;&quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;$ java &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;GreetingServer&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666; margin: 0px; padding: 0px;&quot;&gt;6066&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;Waiting&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;for&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; client on port &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666; margin: 0px; padding: 0px;&quot;&gt;6066.&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;..&lt;/span&gt;&lt;/pre&gt;&lt;div style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 12px; margin-bottom: 1em; margin-top: 0.8em; padding: 0px; text-align: justify;&quot;&gt;Check client program as follows:&lt;/div&gt;&lt;pre class=&quot;prettyprint prettyprinted&quot; style=&quot;background-color: #eeeeee; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; border: 1px solid rgb(214, 214, 214); font-size: 12px; margin-bottom: 10px; overflow: auto; padding: 5px; width: 549.765625px;&quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;$ java &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;GreetingClient&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; localhost &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666; margin: 0px; padding: 0px;&quot;&gt;6066&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;Connecting&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; to localhost on port &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666; margin: 0px; padding: 0px;&quot;&gt;6066&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;Just&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; connected to localhost&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666; margin: 0px; padding: 0px;&quot;&gt;127.0&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666; margin: 0px; padding: 0px;&quot;&gt;0.1&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666; margin: 0px; padding: 0px;&quot;&gt;6066&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;Server&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; says &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;Thank&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; you &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;for&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; connecting to &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666; margin: 0px; padding: 0px;&quot;&gt;127.0&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666; margin: 0px; padding: 0px;&quot;&gt;0.1&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666; margin: 0px; padding: 0px;&quot;&gt;6066&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;Goodbye&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;!&lt;/span&gt;&lt;/pre&gt;&lt;div&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.tutorialspoint.com/java/java_networking.htm#.U8eMQyNPlho.blogger&quot;&gt;Java - Networking (Socket Programming) Tutorial&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://bridroid.blogspot.com/feeds/5589824452615090017/comments/default' title='댓글'/><link rel='replies' type='text/html' href='http://bridroid.blogspot.com/2014/07/java-networking-socket-programming.html#comment-form' title='0개의 덧글'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/905901812770512183/posts/default/5589824452615090017'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/905901812770512183/posts/default/5589824452615090017'/><link rel='alternate' type='text/html' href='http://bridroid.blogspot.com/2014/07/java-networking-socket-programming.html' title='Java - Networking (Socket Programming) Tutorial'/><author><name>brith1225</name><uri>http://www.blogger.com/profile/15293023387175369557</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-905901812770512183.post-2956148310049283330</id><published>2014-07-17T01:37:00.001-07:00</published><updated>2014-07-17T01:39:51.275-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="java"/><title type='text'>Java - Serialization</title><content type='html'>&lt;div style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 12px; margin-bottom: 1em; margin-top: 0.8em; padding: 0px; text-align: justify;&quot;&gt;
Java provides a mechanism, called object serialization where an object can be represented as a sequence of bytes that includes the object&#39;s data as well as information about the object&#39;s type and the types of data stored in the object.&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 12px; margin-bottom: 1em; margin-top: 0.8em; padding: 0px; text-align: justify;&quot;&gt;
After a serialized object has been written into a file, it can be read from the file and deserialized that is, the type information and bytes that represent the object and its data can be used to recreate the object in memory.&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 12px; margin-bottom: 1em; margin-top: 0.8em; padding: 0px; text-align: justify;&quot;&gt;
Most impressive is that the entire process is JVM independent, meaning an object can be serialized on one platform and deserialized on an entirely different platform.&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 12px; margin-bottom: 1em; margin-top: 0.8em; padding: 0px; text-align: justify;&quot;&gt;
Classes&amp;nbsp;&lt;b style=&quot;margin: 0px; padding: 0px;&quot;&gt;ObjectInputStream&lt;/b&gt;&amp;nbsp;and&amp;nbsp;&lt;b style=&quot;margin: 0px; padding: 0px;&quot;&gt;ObjectOutputStream&lt;/b&gt;&amp;nbsp;are high-level streams that contain the methods for serializing and deserializing an object.&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 12px; margin-bottom: 1em; margin-top: 0.8em; padding: 0px; text-align: justify;&quot;&gt;
The ObjectOutputStream class contains many write methods for writing various data types, but one method in particular stands out:&lt;/div&gt;
&lt;pre class=&quot;prettyprint prettyprinted&quot; style=&quot;background-color: #eeeeee; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; border: 1px solid rgb(214, 214, 214); font-size: 12px; margin-bottom: 10px; overflow: auto; padding: 5px; width: 549.765625px;&quot;&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;public&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;final&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;void&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; writeObject&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;Object&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; x&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;throws&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;IOException&lt;/span&gt;&lt;/pre&gt;
&lt;div style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 12px; margin-bottom: 1em; margin-top: 0.8em; padding: 0px; text-align: justify;&quot;&gt;
The above method serializes an Object and sends it to the output stream. Similarly, the ObjectInputStream class contains the following method for deserializing an object:&lt;/div&gt;
&lt;pre class=&quot;prettyprint prettyprinted&quot; style=&quot;background-color: #eeeeee; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; border: 1px solid rgb(214, 214, 214); font-size: 12px; margin-bottom: 10px; overflow: auto; padding: 5px; width: 549.765625px;&quot;&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;public&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;final&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;Object&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; readObject&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;throws&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;IOException&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; 
                                 &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;ClassNotFoundException&lt;/span&gt;&lt;/pre&gt;
&lt;div style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 12px; margin-bottom: 1em; margin-top: 0.8em; padding: 0px; text-align: justify;&quot;&gt;
This method retrieves the next Object out of the stream and deserializes it. The return value is Object, so you will need to cast it to its appropriate data type.&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 12px; margin-bottom: 1em; margin-top: 0.8em; padding: 0px; text-align: justify;&quot;&gt;
To demonstrate how serialization works in Java, I am going to use the Employee class that we discussed early on in the book. Suppose that we have the following Employee class, which implements the Serializable interface:&lt;/div&gt;
&lt;pre class=&quot;prettyprint prettyprinted&quot; id=&quot;employee&quot; style=&quot;background-color: #eeeeee; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; border: 1px solid rgb(214, 214, 214); font-size: 12px; margin-bottom: 10px; overflow: auto; padding: 5px; width: 549.765625px;&quot;&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;public&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;Employee&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;implements&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; java&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;io&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;Serializable&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
   &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;public&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; name&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
   &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;public&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; address&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
   &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;public&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;transient&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;int&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; SSN&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
   &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;public&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;int&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; number&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
   &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;public&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;void&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; mailCheck&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
   &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
      &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;System&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;out&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;println&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;color: #008800; margin: 0px; padding: 0px;&quot;&gt;&quot;Mailing a check to &quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; name
                           &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;color: #008800; margin: 0px; padding: 0px;&quot;&gt;&quot; &quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; address&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
   &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;
&lt;div style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 12px; margin-bottom: 1em; margin-top: 0.8em; padding: 0px; text-align: justify;&quot;&gt;
Notice that for a class to be serialized successfully, two conditions must be met:&lt;/div&gt;
&lt;ul class=&quot;list&quot; style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 12px; list-style: none; margin: 0px; padding: 0px 0px 0px 15px;&quot;&gt;
&lt;li style=&quot;background: url(http://www.tutorialspoint.com/images/icon-bullet.png) 0px 0px no-repeat; margin: 0px; padding: 0px 0px 0px 19px;&quot;&gt;&lt;div style=&quot;margin-bottom: 1em; margin-top: 0.8em; padding: 0px; text-align: justify;&quot;&gt;
The class must implement the java.io.Serializable interface.&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;background: url(http://www.tutorialspoint.com/images/icon-bullet.png) 0px 0px no-repeat; margin: 0px; padding: 0px 0px 0px 19px;&quot;&gt;&lt;div style=&quot;margin-bottom: 1em; margin-top: 0.8em; padding: 0px; text-align: justify;&quot;&gt;
All of the fields in the class must be serializable. If a field is not serializable, it must be marked transient.&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;div style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 12px; margin-bottom: 1em; margin-top: 0.8em; padding: 0px; text-align: justify;&quot;&gt;
If you are curious to know if a Java Standard Class is serializable or not, check the documentation for the class. The test is simple: If the class implements java.io.Serializable, then it is serializable; otherwise, it&#39;s not.&lt;/div&gt;
&lt;h2 style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 1.6em; font-weight: normal; line-height: 1.5em; margin: 0.2em 0.2em 0.2em 0px; padding: 0px; text-shadow: rgb(204, 204, 204) 1px 1px 2px;&quot;&gt;
Serializing an Object:&lt;/h2&gt;
&lt;div style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 12px; margin-bottom: 1em; margin-top: 0.8em; padding: 0px; text-align: justify;&quot;&gt;
The ObjectOutputStream class is used to serialize an Object. The following SerializeDemo program instantiates an Employee object and serializes it to a file.&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 12px; margin-bottom: 1em; margin-top: 0.8em; padding: 0px; text-align: justify;&quot;&gt;
When the program is done executing, a file named employee.ser is created. The program does not generate any output, but study the code and try to determine what the program is doing.&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 12px; margin-bottom: 1em; margin-top: 0.8em; padding: 0px; text-align: justify;&quot;&gt;
&lt;b style=&quot;margin: 0px; padding: 0px;&quot;&gt;Note:&lt;/b&gt;&amp;nbsp;When serializing an object to a file, the standard convention in Java is to give the file a&amp;nbsp;&lt;b style=&quot;margin: 0px; padding: 0px;&quot;&gt;.ser&lt;/b&gt;extension.&lt;/div&gt;
&lt;pre class=&quot;prettyprint tryit prettyprinted&quot; style=&quot;background-attachment: initial !important; background-clip: initial !important; background-color: rgb(238, 238, 238) !important; background-image: url(http://www.tutorialspoint.com/images/link.png) !important; background-origin: initial !important; background-position: 100% 0%; background-repeat: no-repeat !important; background-size: initial !important; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; border: 1px solid rgb(214, 214, 214); cursor: default; font-size: 12px; margin-bottom: 10px; overflow: auto; padding: 5px; width: 549.765625px;&quot; title=&quot;employee&quot;&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;import&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; java&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;io&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.*;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;

&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;public&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;SerializeDemo&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
   &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;public&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;static&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;void&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; main&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;[]&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; args&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
   &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
      &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;Employee&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; e &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;Employee&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
      e&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;name &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;color: #008800; margin: 0px; padding: 0px;&quot;&gt;&quot;Reyan Ali&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
      e&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;address &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;color: #008800; margin: 0px; padding: 0px;&quot;&gt;&quot;Phokka Kuan, Ambehta Peer&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
      e&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;SSN &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666; margin: 0px; padding: 0px;&quot;&gt;11122333&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
      e&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;number &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666; margin: 0px; padding: 0px;&quot;&gt;101&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
      &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;try&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
      &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
         &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;FileOutputStream&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; fileOut &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
         &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;FileOutputStream&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;color: #008800; margin: 0px; padding: 0px;&quot;&gt;&quot;/tmp/employee.ser&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
         &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;ObjectOutputStream&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;out&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;ObjectOutputStream&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;fileOut&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
         &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;out&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;writeObject&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;e&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
         &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;out&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;close&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
         fileOut&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;close&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
         &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;System&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;out&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;printf&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;color: #008800; margin: 0px; padding: 0px;&quot;&gt;&quot;Serialized data is saved in /tmp/employee.ser&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
      &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;catch&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;IOException&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; i&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
      &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
          i&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;printStackTrace&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
      &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
   &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;
&lt;h2 style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 1.6em; font-weight: normal; line-height: 1.5em; margin: 0.2em 0.2em 0.2em 0px; padding: 0px; text-shadow: rgb(204, 204, 204) 1px 1px 2px;&quot;&gt;
Deserializing an Object:&lt;/h2&gt;
&lt;div style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 12px; margin-bottom: 1em; margin-top: 0.8em; padding: 0px; text-align: justify;&quot;&gt;
The following DeserializeDemo program deserializes the Employee object created in the SerializeDemo program. Study the program and try to determine its output:&lt;/div&gt;
&lt;pre class=&quot;prettyprint tryit prettyprinted&quot; style=&quot;background-attachment: initial !important; background-clip: initial !important; background-color: rgb(238, 238, 238) !important; background-image: url(http://www.tutorialspoint.com/images/link.png) !important; background-origin: initial !important; background-position: 100% 0%; background-repeat: no-repeat !important; background-size: initial !important; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; border: 1px solid rgb(214, 214, 214); cursor: default; font-size: 12px; margin-bottom: 10px; overflow: auto; padding: 5px; width: 549.765625px;&quot; title=&quot;employee&quot;&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;import&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; java&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;io&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.*;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;public&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;DeserializeDemo&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
   &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;public&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;static&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;void&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; main&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;[]&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; args&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
   &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
      &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;Employee&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; e &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
      &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;try&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
      &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
         &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;FileInputStream&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; fileIn &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;FileInputStream&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;color: #008800; margin: 0px; padding: 0px;&quot;&gt;&quot;/tmp/employee.ser&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
         &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;ObjectInputStream&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;in&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;ObjectInputStream&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;fileIn&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
         e &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;Employee&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;in&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;readObject&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
         &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;in&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;close&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
         fileIn&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;close&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
      &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;catch&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;IOException&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; i&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
      &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
         i&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;printStackTrace&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
         &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
      &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;catch&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;ClassNotFoundException&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; c&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
      &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
         &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;System&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;out&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;println&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;color: #008800; margin: 0px; padding: 0px;&quot;&gt;&quot;Employee class not found&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
         c&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;printStackTrace&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
         &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
      &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
      &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;System&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;out&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;println&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;color: #008800; margin: 0px; padding: 0px;&quot;&gt;&quot;Deserialized Employee...&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
      &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;System&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;out&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;println&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;color: #008800; margin: 0px; padding: 0px;&quot;&gt;&quot;Name: &quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; e&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
      &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;System&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;out&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;println&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;color: #008800; margin: 0px; padding: 0px;&quot;&gt;&quot;Address: &quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; e&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;address&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
      &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;System&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;out&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;println&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;color: #008800; margin: 0px; padding: 0px;&quot;&gt;&quot;SSN: &quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; e&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;SSN&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
      &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;System&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; margin: 0px; padding: 0px;&quot;&gt;out&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;println&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;color: #008800; margin: 0px; padding: 0px;&quot;&gt;&quot;Number: &quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; e&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;number&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;
&lt;div style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 12px; margin-bottom: 1em; margin-top: 0.8em; padding: 0px; text-align: justify;&quot;&gt;
This would produce the following result:&lt;/div&gt;
&lt;pre class=&quot;prettyprint prettyprinted&quot; style=&quot;background-color: #eeeeee; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; border: 1px solid rgb(214, 214, 214); font-size: 12px; margin-bottom: 10px; overflow: auto; padding: 5px; width: 549.765625px;&quot;&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;Deserialized&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;Employee&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;Name&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;Reyan&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;Ali&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;Address&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;Phokka&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;Kuan&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;Ambehta&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;Peer&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
SSN&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666; margin: 0px; padding: 0px;&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #7f0055; margin: 0px; padding: 0px;&quot;&gt;Number&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; margin: 0px; padding: 0px;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666; margin: 0px; padding: 0px;&quot;&gt;101&lt;/span&gt;&lt;/pre&gt;
&lt;div style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 12px; margin-bottom: 1em; margin-top: 0.8em; padding: 0px; text-align: justify;&quot;&gt;
Here are following important points to be noted:&lt;/div&gt;
&lt;ul class=&quot;list&quot; style=&quot;background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 12px; list-style: none; margin: 0px; padding: 0px 0px 0px 15px;&quot;&gt;
&lt;li style=&quot;background: url(http://www.tutorialspoint.com/images/icon-bullet.png) 0px 0px no-repeat; margin: 0px; padding: 0px 0px 0px 19px;&quot;&gt;&lt;div style=&quot;margin-bottom: 1em; margin-top: 0.8em; padding: 0px; text-align: justify;&quot;&gt;
The try/catch block tries to catch a ClassNotFoundException, which is declared by the readObject() method. For a JVM to be able to deserialize an object, it must be able to find the bytecode for the class. If the JVM can&#39;t find a class during the deserialization of an object, it throws a ClassNotFoundException.&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;background: url(http://www.tutorialspoint.com/images/icon-bullet.png) 0px 0px no-repeat; margin: 0px; padding: 0px 0px 0px 19px;&quot;&gt;&lt;div style=&quot;margin-bottom: 1em; margin-top: 0.8em; padding: 0px; text-align: justify;&quot;&gt;
Notice that the return value of readObject() is cast to an Employee reference.&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;background: url(http://www.tutorialspoint.com/images/icon-bullet.png) 0px 0px no-repeat; margin: 0px; padding: 0px 0px 0px 19px;&quot;&gt;&lt;div style=&quot;margin-bottom: 1em; margin-top: 0.8em; padding: 0px; text-align: justify;&quot;&gt;
The value of the SSN field was 11122333 when the object was serialized, but because the field is transient, this value was not sent to the output stream. The SSN field of the deserialized Employee object is 0.&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;a href=&quot;http://www.tutorialspoint.com/java/java_serialization.htm#.U8eLMcGU0Xw.blogger&quot;&gt;Java - Serialization&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://bridroid.blogspot.com/feeds/2956148310049283330/comments/default' title='댓글'/><link rel='replies' type='text/html' href='http://bridroid.blogspot.com/2014/07/java-serialization.html#comment-form' title='0개의 덧글'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/905901812770512183/posts/default/2956148310049283330'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/905901812770512183/posts/default/2956148310049283330'/><link rel='alternate' type='text/html' href='http://bridroid.blogspot.com/2014/07/java-serialization.html' title='Java - Serialization'/><author><name>brith1225</name><uri>http://www.blogger.com/profile/15293023387175369557</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-905901812770512183.post-8992280894645118588</id><published>2014-07-17T01:32:00.003-07:00</published><updated>2014-07-17T01:32:41.575-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="java"/><title type='text'>자바8 람다 소개(펌 http://javacan.tistory.com)</title><content type='html'>&lt;iframe allowfullscreen=&quot;&quot; frameborder=&quot;0&quot; height=&quot;356&quot; marginheight=&quot;0&quot; marginwidth=&quot;0&quot; scrolling=&quot;no&quot; src=&quot;//www.slideshare.net/slideshow/embed_code/35205661&quot; style=&quot;border-width: 1px 1px 0; border: 1px solid #CCC; margin-bottom: 5px; max-width: 100%;&quot; width=&quot;427&quot;&gt; &lt;/iframe&gt; &lt;br /&gt;
&lt;div style=&quot;margin-bottom: 5px;&quot;&gt;
&lt;strong&gt; &lt;a href=&quot;https://www.slideshare.net/madvirus/8-35205661&quot; target=&quot;_blank&quot; title=&quot;자바8 람다식 소개&quot;&gt;자바8 람다식 소개&lt;/a&gt; &lt;/strong&gt; from &lt;strong&gt;&lt;a href=&quot;http://www.slideshare.net/madvirus&quot; target=&quot;_blank&quot;&gt;beom kyun choi&lt;/a&gt;&lt;/strong&gt; &lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://bridroid.blogspot.com/feeds/8992280894645118588/comments/default' title='댓글'/><link rel='replies' type='text/html' href='http://bridroid.blogspot.com/2014/07/8-httpjavacantistorycom.html#comment-form' title='0개의 덧글'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/905901812770512183/posts/default/8992280894645118588'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/905901812770512183/posts/default/8992280894645118588'/><link rel='alternate' type='text/html' href='http://bridroid.blogspot.com/2014/07/8-httpjavacantistorycom.html' title='자바8 람다 소개(펌 http://javacan.tistory.com)'/><author><name>brith1225</name><uri>http://www.blogger.com/profile/15293023387175369557</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-905901812770512183.post-7961407473174719302</id><published>2014-07-17T01:27:00.000-07:00</published><updated>2014-07-17T01:31:11.046-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="java"/><title type='text'>자바8 스트림 API 소개(펌 http://javacan.tistory.com)</title><content type='html'>&lt;iframe allowfullscreen=&quot;&quot; frameborder=&quot;0&quot; height=&quot;356&quot; marginheight=&quot;0&quot; marginwidth=&quot;0&quot; scrolling=&quot;no&quot; src=&quot;//www.slideshare.net/slideshow/embed_code/35408257&quot; style=&quot;border-width: 1px 1px 0; border: 1px solid #CCC; margin-bottom: 5px; max-width: 100%;&quot; width=&quot;427&quot;&gt; &lt;/iframe&gt; &lt;br /&gt;
&lt;div style=&quot;margin-bottom: 5px;&quot;&gt;
&lt;strong&gt; &lt;a href=&quot;https://www.slideshare.net/madvirus/8-api&quot; target=&quot;_blank&quot; title=&quot;자바8 스트림 API 소개&quot;&gt;자바8 스트림 API 소개&lt;/a&gt; &lt;/strong&gt; from &lt;strong&gt;&lt;a href=&quot;http://www.slideshare.net/madvirus&quot; target=&quot;_blank&quot;&gt;beom kyun choi&lt;/a&gt;&lt;/strong&gt; &lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://bridroid.blogspot.com/feeds/7961407473174719302/comments/default' title='댓글'/><link rel='replies' type='text/html' href='http://bridroid.blogspot.com/2014/07/8-api-httpjavacantistorycom.html#comment-form' title='0개의 덧글'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/905901812770512183/posts/default/7961407473174719302'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/905901812770512183/posts/default/7961407473174719302'/><link rel='alternate' type='text/html' href='http://bridroid.blogspot.com/2014/07/8-api-httpjavacantistorycom.html' title='자바8 스트림 API 소개(펌 http://javacan.tistory.com)'/><author><name>brith1225</name><uri>http://www.blogger.com/profile/15293023387175369557</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-905901812770512183.post-9041973786449153255</id><published>2011-07-29T21:35:00.000-07:00</published><updated>2014-07-17T01:33:15.068-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="android"/><title type='text'>[안드로이드] 메모리 누수 OutOfMemoryError 관련 링크들</title><content type='html'>&lt;div style=&quot;font-size: 12px; line-height: 19px;&quot;&gt;가끔씩 마주치게 되는 &quot;OutOfMemoryError : bitmap size exceeds VM budget&quot; 에러는 메모리 누수가 주요 원인입니다. 이와 관련된 링크를 모아봤습니다.&lt;/div&gt;&lt;div style=&quot;font-size: 12px; line-height: 19px;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;font-size: 12px; line-height: 19px;&quot;&gt;&lt;strong&gt;* 액티비티가 멈출 때 비트맵을 재활용(즉 GC)되게 하라&lt;/strong&gt;&lt;/div&gt;&lt;div style=&quot;font-size: 12px; line-height: 19px;&quot;&gt;&lt;a href=&quot;http://stackoverflow.com/questions/1949066/java-lang-outofmemoryerror-bitmap-size-exceeds-vm-budget-android&quot; target=&quot;_blank&quot; title=&quot;[http://stackoverflow.com/questions/1949066/java-lang-outofmemoryerror-bitmap-size-exceeds-vm-budget-android]로 이동합니다.&quot;&gt;&lt;span style=&quot;color: #5a5194;&quot;&gt;http://stackoverflow.com/questions/1949066/java-lang-outofmemoryerror-bitmap-size-exceeds-vm-budget-android&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;font-size: 12px; line-height: 19px;&quot;&gt;&lt;a href=&quot;http://stackoverflow.com/questions/2191407/changing-imageview-content-causes-outofmemoryerror&quot; target=&quot;_blank&quot; title=&quot;[http://stackoverflow.com/questions/2191407/changing-imageview-content-causes-outofmemoryerror]로 이동합니다.&quot;&gt;&lt;span style=&quot;color: #5a5194;&quot;&gt;http://stackoverflow.com/questions/2191407/changing-imageview-content-causes-outofmemoryerror&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;font-size: 12px; line-height: 19px;&quot;&gt;&lt;span style=&quot;color: #5a5194;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-size: 12px; line-height: 19px;&quot;&gt;- bitmap 이미지인 경우 recycle() 호출&lt;/div&gt;&lt;div style=&quot;font-size: 12px; line-height: 19px;&quot;&gt;- onPause에서 수행하는게 좋음&lt;/div&gt;&lt;div style=&quot;font-size: 12px; line-height: 19px;&quot;&gt;- ((BitmapDrawable)imageView.getDrawable()).getBitmap().recycle();&lt;/div&gt;&lt;div style=&quot;font-size: 12px; line-height: 19px;&quot;&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;font-size: 12px; line-height: 19px;&quot;&gt;&lt;strong&gt;* 이미지를 미리 줄여서 읽어들여라&lt;/strong&gt;&lt;/div&gt;&lt;div style=&quot;font-size: 12px; line-height: 19px;&quot;&gt;&lt;a href=&quot;http://chiyo85.tistory.com/entry/Android-Bitmap-Object-Resizing-Tip&quot; target=&quot;_blank&quot; title=&quot;[http://chiyo85.tistory.com/entry/Android-Bitmap-Object-Resizing-Tip]로 이동합니다.&quot;&gt;&lt;span style=&quot;color: #5a5194;&quot;&gt;http://chiyo85.tistory.com/entry/Android-Bitmap-Object-Resizing-Tip&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;font-size: 12px; line-height: 19px;&quot;&gt;&lt;a href=&quot;http://www.memofy.com/memofy/show/1008ab7f2836ab7f01071c2dbfe138/outofmemory-exception-when-decoding-with-bitmapfactory&quot; target=&quot;_blank&quot; title=&quot;[http://www.memofy.com/memofy/show/1008ab7f2836ab7f01071c2dbfe138/outofmemory-exception-when-decoding-with-bitmapfactory ]로 이동합니다.&quot;&gt;&lt;span style=&quot;color: #5a5194;&quot;&gt;http://www.memofy.com/memofy/show/1008ab7f2836ab7f01071c2dbfe138/outofmemory-exception-when-decoding-with-bitmapfactory&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;font-size: 12px; line-height: 19px;&quot;&gt;&lt;span style=&quot;color: #5a5194;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-size: 12px; line-height: 19px;&quot;&gt;- BitmapFactory.Options.inSampleSize 활용&lt;/div&gt;&lt;div style=&quot;font-size: 12px; line-height: 19px;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;font-size: 12px; line-height: 19px;&quot;&gt;&lt;strong&gt;* Activity Context에 대한 참조(reference)를 오랫동안 유지하지 말아라&lt;/strong&gt;&lt;/div&gt;&lt;div style=&quot;font-size: 12px; line-height: 19px;&quot;&gt;&lt;a href=&quot;http://android-developers.blogspot.com/2009/01/avoiding-memory-leaks.html&quot; target=&quot;_blank&quot; title=&quot;[http://android-developers.blogspot.com/2009/01/avoiding-memory-leaks.html]로 이동합니다.&quot;&gt;&lt;span style=&quot;color: #5a5194;&quot;&gt;http://android-developers.blogspot.com/2009/01/avoiding-memory-leaks.html&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;font-size: 12px; line-height: 19px;&quot;&gt;( 한글 번역 :&amp;nbsp;&lt;a href=&quot;http://blog.naver.com/huewu/110082062273&quot;&gt;&lt;span style=&quot;color: #5a5194;&quot;&gt;http://blog.naver.com/huewu/110082062273&lt;/span&gt;&lt;/a&gt;&amp;nbsp;)&lt;/div&gt;&lt;div style=&quot;font-size: 12px; line-height: 19px;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;font-size: 12px; line-height: 19px;&quot;&gt;&lt;div&gt;&lt;div&gt;- Drawable.setCallback(null) 사용&lt;/div&gt;&lt;/div&gt;&lt;div&gt;-&amp;nbsp;WeakReference를 가진 static 내부 클래스&lt;/div&gt;&lt;div&gt;&lt;div&gt;- 이미지를 static 변수로 처리하지 마라&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;strong&gt;*&amp;nbsp;외부(outer) 클래스의 상태에 의존하지 않는 내부(inner) 클래스는 static으로 선언하라&lt;/strong&gt;&lt;/div&gt;&lt;div&gt;- 내부클래스는 외부 클래스 인스턴스를 크게 만들며 또한 외부클래스 객체가 필요이상으로 오래 살아있게 되어 메모리를 더 차지할 수 있음&lt;/div&gt;&lt;div&gt;- 외부클래스의 상태 필드에 접근하지 않는(즉 외부 객체의 상태에 의존하지 않는) 내부클래스는 static으로 선언&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;font-size: 12px; line-height: 19px;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;font-size: 12px; line-height: 19px;&quot;&gt;&lt;strong&gt;* Attacking memory problems on Android&lt;/strong&gt;&lt;/div&gt;&lt;div style=&quot;font-size: 12px; line-height: 19px;&quot;&gt;&lt;a href=&quot;http://ttlnews.blogspot.com/2010/01/attacking-memory-problems-on-android.html&quot;&gt;&lt;span style=&quot;color: #5a5194;&quot;&gt;http://ttlnews.blogspot.com/2010/01/attacking-memory-problems-on-android.html&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;font-size: 12px; line-height: 19px;&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;font-size: 12px; line-height: 19px;&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;font-size: 12px; line-height: 19px;&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;font-size: 12px; line-height: 19px;&quot;&gt;&lt;span style=&quot;color: #ff6c00; font-size: 18px;&quot;&gt;&lt;strong&gt;출처 :&amp;nbsp;&lt;/strong&gt;&lt;/span&gt;&lt;a href=&quot;http://ecogeo.tistory.com/287&quot;&gt;&lt;span style=&quot;color: #ff6c00; font-size: 18px;&quot;&gt;&lt;strong&gt;http://ecogeo.tistory.com/287&lt;/strong&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bridroid.blogspot.com/feeds/9041973786449153255/comments/default' title='댓글'/><link rel='replies' type='text/html' href='http://bridroid.blogspot.com/2011/07/outofmemoryerror.html#comment-form' title='0개의 덧글'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/905901812770512183/posts/default/9041973786449153255'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/905901812770512183/posts/default/9041973786449153255'/><link rel='alternate' type='text/html' href='http://bridroid.blogspot.com/2011/07/outofmemoryerror.html' title='[안드로이드] 메모리 누수 OutOfMemoryError 관련 링크들'/><author><name>brith1225</name><uri>http://www.blogger.com/profile/15293023387175369557</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-905901812770512183.post-327524103387883226</id><published>2011-07-14T22:31:00.000-07:00</published><updated>2014-07-17T01:33:15.048-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="android"/><title type='text'>Android ODEX Reverse Engineering(DE-ODEX)</title><content type='html'>우선 ODEX라는 것이 무엇일까?&lt;br /&gt;
http://mylifewithandroid.blogspot.com/2009/02/optimized-dex-files.html&lt;br /&gt;
위 블로그에 보면 아주 내용이 잘 정리 되어있다. Optimized dex 로써 성능향상을 위해 Hardware에 최적화되어 만들어진 dex file이다. HTC의 단말기들에 있는 app들을 까보면 apk파일과 odex 파일 두개로 이루어져있다.&lt;br /&gt;
(그리고 apk file을 압축을 풀어 확인해보면 classes.dex 파일이 존재 하지 않는다.)&lt;br /&gt;
&lt;br /&gt;
ODEX를 classes.dex로 바꿔보자!&lt;br /&gt;
1. http://code.google.com/p/smali/downloads/list 사이트에서 smali.jar와 baksmali.jar를 다운로드한다.&lt;br /&gt;
1. Android Phone을 Android SDK가 깔려있는 PC에 연결&lt;br /&gt;
2. adb pull system system&lt;br /&gt;
3. java -jar baksmali.jar -d system/framework -x temp.odex(odex파일 경로)&lt;br /&gt;
(참조: http://code.google.com/p/smali/wiki/DeodexInstructions)&lt;br /&gt;
이렇게 하면 out이라는 폴더 안에 smali format으로 odex가 풀려있게 된다.&lt;br /&gt;
4. java -jar smali.jar -o classes.dex out&lt;br /&gt;
이렇게 해서 우리가 원하는 classes.dex 파일이 생성되었다.&lt;br /&gt;
&lt;br /&gt;
APK파일로...&lt;br /&gt;
classes.dex가 없는 apk 파일에 추가하여 다시 압축 한 후 http://leehacks.blogspot.com/2010/05/android-apk-reverse-engineering.html 포스팅에서 언급한 apktool로 다시한번 풀어줬다가 apk로 묶어주면 된다.&lt;br /&gt;
물론 위 포스팅에서 언급한대로 sign도 해줘야 install이 가능하다.&lt;br /&gt;
&lt;br /&gt;
http://code.google.com/p/android-apktool/ &lt;br /&gt;
1. 해당 사이트에서 apktool을 다운로드하고 기재된 install방법으로 설치한다.&lt;br /&gt;
2. apk 디코딩&lt;br /&gt;
&amp;gt;apktool d -d name.apk out&lt;br /&gt;
3. classes.dex 파일을 out 폴더에 copy&lt;br /&gt;
4. apk 빌드&lt;br /&gt;
&amp;gt;apktool b -d out&lt;br /&gt;
5. 위까지 수행하게 되면 out/dist/out.apk 가 생성되며 이 out.apk를 sign해주면 완료.&lt;br /&gt;
&lt;br /&gt;
jarsigner -verbose -keystore E:\Works\Android\Android_2.1_Library\debug.keystore out.apk KEYNAME(ex: yunjinsung_key)</content><link rel='replies' type='application/atom+xml' href='http://bridroid.blogspot.com/feeds/327524103387883226/comments/default' title='댓글'/><link rel='replies' type='text/html' href='http://bridroid.blogspot.com/2011/07/android-odex-reverse-engineeringde-odex.html#comment-form' title='0개의 덧글'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/905901812770512183/posts/default/327524103387883226'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/905901812770512183/posts/default/327524103387883226'/><link rel='alternate' type='text/html' href='http://bridroid.blogspot.com/2011/07/android-odex-reverse-engineeringde-odex.html' title='Android ODEX Reverse Engineering(DE-ODEX)'/><author><name>brith1225</name><uri>http://www.blogger.com/profile/15293023387175369557</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-905901812770512183.post-4323375996446868092</id><published>2011-04-11T19:29:00.001-07:00</published><updated>2014-07-17T01:33:15.055-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="android"/><title type='text'>[번역] The Android 3.0 Fragments API</title><content type='html'>&lt;div&gt;&lt;h2 class=&quot;post-title entry-title&quot; style=&quot;border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; margin: 1em 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;/h2&gt;&lt;h2 class=&quot;post-title entry-title&quot; style=&quot;border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; color: #435a6e; font-family: arial, sans-serif; font-size: 13px; line-height: normal; margin: 1em 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span style=&quot;color: #435a6e; font-family: tahoma; font-size: 18pt; text-decoration: none;&quot;&gt;&lt;a class=&quot;con_link&quot; href=&quot;http://android-developers.blogspot.com/2011/02/android-30-fragments-api.html&quot; style=&quot;color: #435a6e; text-decoration: none;&quot; target=&quot;_blank&quot;&gt;The Android 3.0 Fragments API&lt;/a&gt;&lt;/span&gt;&lt;/h2&gt;&lt;h2 class=&quot;post-title entry-title&quot; style=&quot;border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; font-size: 13px; margin: 1em 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: 돋움, dotum; font-weight: normal; line-height: 15px;&quot;&gt;[이 포스트는  안드로이드 개발에 핵심적인 역할을 담당하는,&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: black; font-family: 돋움, dotum; font-weight: normal;&quot;&gt;소프트웨어  엔지니어&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: normal;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: black; font-family: 돋움, dotum; font-weight: normal; line-height: 13px;&quot;&gt;Dianne  Hackborn 에 의해 작성되었습니다.&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: black; font-family: 돋움, dotum; font-weight: normal; line-height: 13px;&quot;&gt;&amp;nbsp;-  Tim Bray]&lt;/span&gt;&lt;/span&gt;&lt;/h2&gt;&lt;h2 class=&quot;post-title entry-title&quot; style=&quot;border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; font-size: 13px; margin: 1em 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;div style=&quot;color: #435a6e; font-family: arial, sans-serif; line-height: 1;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: black; font-family: 돋움, dotum; font-weight: normal; line-height: 13px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #435a6e; font-family: arial, sans-serif; line-height: normal;&quot;&gt;&lt;span style=&quot;font-family: 돋움, dotum; font-size: 10pt;&quot;&gt;원문:&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: black; font-family: 돋움, Dotum, AppleGothic, sans-serif; font-size: 18px; line-height: 27px;&quot;&gt;&lt;span style=&quot;font-family: 돋움, dotum; font-size: 10pt;&quot;&gt;&lt;a class=&quot;con_link&quot; href=&quot;http://android-developers.blogspot.com/2011/02/android-30-fragments-api.html&quot; target=&quot;_blank&quot;&gt;http://android-developers.blogspot.com/2011/02/android-30-fragments-api.html&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 1.2;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: 돋움, dotum;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: normal;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/h2&gt;&lt;h2 class=&quot;post-title entry-title&quot; style=&quot;border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; color: #435a6e; font-size: 13px; line-height: normal; margin: 1em 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: black; font-weight: normal; line-height: 26px;&quot;&gt;&amp;nbsp;안드로이드 3.0 의  주요 목표 중 하나는, 개발자들이 보다 쉽게 다양한 해상도를 지원하는 어플리케이션을 작성할 수 있도록 만들어 주는 것 입니다. 다양한 해상도를  지원하는 어플리케이션을 개발 할 수 있도록, 지금까지 안드로이드 플랫폼에서는 다음과 같은 기능을 지원해 주고  있었습니다.&lt;/span&gt;&lt;/h2&gt;&lt;/div&gt;&lt;div&gt;&lt;ul style=&quot;line-height: 2;&quot;&gt;&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 13px; line-height: 26px;&quot;&gt;애초부터, 안드로이드 UI 프레임워크는 레이아웃 매니저 계층을  사용하도록 구성되었습니다. 레이아웃 매니저를 통해, UI 구성 요소들은 현재 활용 가능한 화면 크기에 맞추어 적절하게 자신의 크기와 위치를  조절할 수 있습니다. 한 가지 예로 ListView 의 높이는 디바이스의 화면 크기가 QVGA, HVGA, WVGA 이건 무관하게, 또한 화면이  가로 세로 비율이 어떻든간에 화면에 꼭 맞추어 알아서 크기가 조절됩니다.&amp;nbsp;&lt;/span&gt; &lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;안드로이드 1.6 에서는 Screen Density (DIP) 라는 새로운 개념이  소개되었습니다. 이를 통해, 개발자들은&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 13px; line-height: 26px;&quot;&gt;실재 물리적인 화면 크기가 유사한 경우,&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 13px; line-height: 26px;&quot;&gt;화면 해상도에대하여 별다른  고민없이 다양한 해상도의 휴대 단말을 지원하는 &amp;nbsp;UI 를 구성할 수 있게 되었습니다. 덕분에, 1.6 발표 이 후 출시된 모토로이 드로이드와  같은 다양한 고해상도 휴대폰등에서 별다른 호환성 문제 없이 기존의 어플리케이션이 동작할 수 있었습니다.&lt;/span&gt; &lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 13px; line-height: 26px;&quot;&gt;또한,  안드로이드 1.6 에서는 화면의 크기를 몇 가지 카테고리로 나누어 분류 하였습니다. QVGA 급 화면은 &quot;small&quot; , HVGA 나 WVGA  급 화면은 &quot;normal&quot;, 그 이상의 크기를 갖는 경우에는 &quot;large&quot; 로 말이지요. 어플리케이션 개발자는 안드로이드에서 제공하는 리소스  시스템을 활용하여, 자신의 어플에서 사용되는 리소스와 화면 레이아웃을 서로 다른 해상도에 맞추어 구분하여 구성할 수 있게  되었습니다.&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 13px; line-height: 26px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 13px; line-height: 26px;&quot;&gt;&amp;nbsp;레이아웃 메니저와 화면 크기에 따라 유연하게 동작하는 리소스  선택 시스템은 &#39;개발자들이 다양한 크기의 안드로이드 디바이스에서 자연스럽게 동작하는 어플리케이션을 만들 수 있게 하자&#39; 는 원대한 목표하에서  구현되었습니다. 그리고 결과적으로, 다행스럽게도 기존에 개발된 많은 어플리케이션이 최근 새롭게 발표된 10인치 크기의 타블렛용 OS 인 허니콤  상에서 별다른 문제 없이 &#39;잘&#39; 동작하는 것으로 확인되고 있습니다. 하지만, 허니콤이 공개되고 타블렛을 위해 UI 요소에 많은 변화가 생김에  따라, 안드로이드 개발팀은 &#39;만일 기존 어플리케이션이 10인치의 타블렛을 위해 고안된 새로운 UI 요소들을 손 쉽게 활용 할 수 있다면 여러가지  추가적인 장점을 누릴 수 있지 않을까&#39; 고민하게 되었습니다. 그 결과, Fragment 클래스가  추가되었습니다.&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;line-height: 2;&quot;&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&lt;b&gt;Introducing the  Fragment&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 24px;&quot;&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&amp;nbsp;어플리케이션 개발자는 안드로이드 3.0 에서 새롭게 추가된 Fragment 클래스를  이용하여&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 13px; line-height: 26px;&quot;&gt;&amp;nbsp;어플리케이션의 UI 를 보다 상황에 따라 변경하거나 조절할 수  있습니다.&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 13px; line-height: 26px;&quot;&gt;Fragment 는 별도의 UI 와 생명주기를 갖는 독립된  어플리케이션 컴포넌트입니다. 따라서, 여러분은 특정 디바이스 혹은 스크린 해상도에 따라서, 여러 개의 Fragment 를 조합하거나 재배치 하는  방식으로 원하는 UI 를 손쉽게 구성할 수 있습니다.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 13px; line-height: 26px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 13px; line-height: 26px;&quot;&gt;&amp;nbsp;다시말해, Fragment 는 미니 엑티비티라고 생각하실 수  있습니다. 일반적인 엑티비티와는 다르게, 반드시 실재 엑티비티에 포함되어 동작해야 되긴 하지만 말이지요. 안드로이드 개발팀은 Fragment  관련 기능을 추가하면서, 어플리케이션 개발자들이 엑티비티를 사용할 때 겪게 되는 일반적인 불편함에 대해 다시 살펴보고 이를 해결할 수 있는  방안을 검토했으며, 그 결과 개발된 Fragment API 는 그저 다양한 해상도나 화면 모드에 따라 UI 를 변경하는 기능 이상의 역할을 수행  할 수 있습니다.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 13px; line-height: 26px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;ul style=&quot;line-height: 2;&quot;&gt;&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 13px; line-height: 26px;&quot;&gt;이전  버전의 안드로이드 프레임워크 상에서도, 엑티비티 그룹(ActivityGroup)을 이용하여 복 수의 엑티비티를 하나의 엑티비티에 담을 수  있습니다. (주&amp;gt; 대표적으로 TabActivity) 하지만, 기본적으로 엑티비티는 독립적으로 동작하도록 설계되었기 때문에, 엑티비티 그룹을  적절하게 활용하는 것은 결코 쉬운일이 아니였습니다. Fragment API 를 활용하면 이런 일을 훨씬 더 잘 처리할 수 있으며, 따라서  안드로이드 개발팀은 Fragment 컴포넌트를 이용하면 기존의 임베디드 엑티비티를 완전히 대체할 수 있지 않을까 생각하고 있습니다.&lt;/span&gt; &lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 13px; line-height: 26px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 13px; line-height: 26px;&quot;&gt;지금까지 화면이 회전되거나 설정 값이 변경됨에 현재 엑티비티가  Destroy 되고 뒤이어 새로운 엑티비티가 생성되는 경우, 두 엑티비티 인스턴스간에 데이타를 유지하기 위해서는,&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 13px; line-height: 26px;&quot;&gt;Activity.onRetainNonConfigurationInstance()  메서드를 활용해야 했습니다. (주&amp;gt; 많은 분들이 단순하게 아예 엑티비티가 새로 생성되지 않도록 막는 경우가 있지만, 화면 모드에 따라 전혀  다른 UI 를 제공하고자 한다면 별 수 없이 새로운 엑티비티 인스턴스가 생성되어야 합니다.)&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 13px; line-height: 26px;&quot;&gt;&amp;nbsp;뭐, 크게 어려운 일은  아닐지라도 좀 투박하고 불명확한 솔루션이었지요. Fragment API 를 활용하면, 특정 Fragment 인스턴스에 적절한 플래그만 설정해  주시면, 프레임워크 내에서 해당 인스턴스를 보존해 줍니다.&lt;/span&gt; &lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 18px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 13px; line-height: 26px;&quot;&gt;DialogFragment  클래스가 제공됩니다. 이 새로운 클래스를 활용하면, 엑티비티 라이프 사이클에 잘 부합되도록 다이얼로그 박스를 표시하는게 훨씬 수월해 줍니다.  (주&amp;gt; 예를 들어, 화면이 회전되는 등의 이유로 엑티비티가 종료되고 재 시작될 때, 기존 다이얼로그 박스에서 표시된 정보를 똑같이 복원하기  위해서는 꽤나 골치아픈 작업이 필요했지요....) 엑티비티가 기존에 엑티비티에서 사용되던&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 13px; line-height: 26px;&quot;&gt;&quot;managed  dialog API&quot; 를 대채할 수 있습니다.&lt;/span&gt;&lt;/span&gt; &lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 13px; line-height: 26px;&quot;&gt;또  한가지 ListFragment 클래스가 제공됩니다. 이 클래스를 활용하면, 데이타 목록을 손쉽게 표시할 수 있습니다. 몇 가지 기능이 추가된  점을 제외하면, 기존 ListActivity 와 유사하지만, Fragment 특성 상, 임의의 엑티비티에 손쉽게 포함될 수 있기 때문에, 흔한  질문 중 하나인, &#39;데이타 목록과 동시에 여러가지 추가 정보를 표시하려면 어떻게 하나요?&#39; 같은 문제를 손쉽게 해결 할 수 있게 도와줄 것  입니다.&lt;/span&gt; &lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 13px; line-height: 26px;&quot;&gt;현재  실행중인 엑티비티에 포함되어 있는 모든 Fragment 인스턴스 정보는 해당 엑티비티의 &#39;saved instance state&#39; 로 자동으로  저장되며, 엑티비티가 잠시 종료되었다가 재 시작될 때 자동으로 복원됩니다. 따라서 여러분이 UI의 상태 정보를 저장, 관리하기 위해 들이는  귀찮은 작업을 대폭 감소시킬 수 있습니다.&lt;/span&gt; &lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 13px; line-height: 26px;&quot;&gt;안드로이드 프레임워크는 Fragment &amp;nbsp;인스턴스의  &#39;back-stack&#39;(이전 상태를 저장해 두는 스택) 을 관리합니다. 따라서 여러분은 엑티비티 내부에 뒤로 가기 버튼등의 기능을 손쉽게 구현  할 수 있습니다.&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 13px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 26px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 2;&quot;&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&lt;b&gt;Getting  started&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 13px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 26px;&quot;&gt;&amp;nbsp;Fragment 에 대한 여러분의 궁금증을 달래기 위해, 이를 활용하여 화면 모드에 따라서 UI  가 완전히 변화되는 어플리케이션을 만들기 위한 샘플 코드를 설명해 볼까 합니다. 우선, 화면이 랜드스케이프(가로) 모드일 때, 화면 왼쪽에  아이템 목록이 표시되고, 오른편에는 선택된 아이템의 상세 정보가 표시되는 레이아웃을 디자인 해 보도록  하겠습니다.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 13px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 26px;&quot;&gt;&lt;img id=&quot;_GTM_W5mVPTU/TUsiB0_SZiI/AAAAAAAAAQ0/FtxDiayMsN8/s400/device-fragment-land.png&quot; src=&quot;http://3.bp.blogspot.com/_GTM_W5mVPTU/TUsiB0_SZiI/AAAAAAAAAQ0/FtxDiayMsN8/s400/device-fragment-land.png&quot; style=&quot;cursor: pointer;&quot; /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;line-height: 2;&quot;&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;이런 엑티비티를 위한 코드는 별 다를게  없습니다. 그저, onCreate() 시점에 setContentView() 메서드를 호출하여, 아래의 레이아웃 코드를 설정해주면  됩니다.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: arial, sans-serif; font-size: 13px; line-height: normal;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot; style=&quot;background-color: #fafafa; border-bottom: rgb(204,204,204) 1px solid; border-left: rgb(204,204,204) 1px solid; border-right: rgb(204,204,204) 1px solid; border-top: rgb(204,204,204) 1px solid; color: #007000; font-family: monospace; margin: 0px 0px 1em 1em; overflow-x: auto; overflow-y: auto; padding-bottom: 10px; padding-left: 10px; padding-right: 10px; padding-top: 10px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: arial, sans-serif; font-size: 13px; line-height: normal;&quot;&gt;&lt;code style=&quot;color: #007000; font-family: monospace; line-height: 1em;&quot;&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088; font-size: 9pt;&quot;&gt;&amp;lt;LinearLayout&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;color: #882288; font-size: 9pt;&quot;&gt;xmlns:android&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800; font-size: 9pt;&quot;&gt;&quot;&lt;a class=&quot;con_link&quot; href=&quot;http://schemas.android.com/apk/res/android&quot; target=&quot;_blank&quot;&gt;http://schemas.android.com/apk/res/android&quot;&lt;/a&gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;color: #882288; font-size: 9pt;&quot;&gt;android:orientation&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800; font-size: 9pt;&quot;&gt;&quot;horizontal&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;color: #882288; font-size: 9pt;&quot;&gt;android:layout_width&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800; font-size: 9pt;&quot;&gt;&quot;match_parent&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;color: #882288; font-size: 9pt;&quot;&gt;android:layout_height&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800; font-size: 9pt;&quot;&gt;&quot;match_parent&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088; font-size: 9pt;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;

&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088; font-size: 9pt;&quot;&gt;&amp;lt;fragment&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;color: #882288; font-size: 9pt;&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800; font-size: 9pt;&quot;&gt;&quot;com.example.android.apis.app.TitlesFragment&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;color: #882288; font-size: 9pt;&quot;&gt;android:id&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800; font-size: 9pt;&quot;&gt;&quot;@+id/titles&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;color: #882288; font-size: 9pt;&quot;&gt;android:layout_weight&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800; font-size: 9pt;&quot;&gt;&quot;1&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;color: #882288; font-size: 9pt;&quot;&gt;android:layout_width&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800; font-size: 9pt;&quot;&gt;&quot;0px&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;color: #882288; font-size: 9pt;&quot;&gt;android:layout_height&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800; font-size: 9pt;&quot;&gt;&quot;match_parent&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088; font-size: 9pt;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;

&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088; font-size: 9pt;&quot;&gt;&amp;lt;FrameLayout&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;color: #882288; font-size: 9pt;&quot;&gt;android:id&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800; font-size: 9pt;&quot;&gt;&quot;@+id/details&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;color: #882288; font-size: 9pt;&quot;&gt;android:layout_weight&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800; font-size: 9pt;&quot;&gt;&quot;1&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;color: #882288; font-size: 9pt;&quot;&gt;android:layout_width&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800; font-size: 9pt;&quot;&gt;&quot;0px&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;color: #882288; font-size: 9pt;&quot;&gt;android:layout_height&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800; font-size: 9pt;&quot;&gt;&quot;match_parent&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088; font-size: 9pt;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088; font-size: 9pt;&quot;&gt;&amp;lt;/LinearLayout&amp;gt;&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 13px; line-height: 26px;&quot;&gt;&amp;nbsp;레이아웃 코드를 살펴 보시면, 새롭게 추가된  &amp;lt;fragment&amp;gt; 태그를 확인 할 수 있습니다. 이 태그를 사용하면 프레임워크에서 자동적으로 Fragment 인스턴스를 생성하고,  생성된 Fragment 인스턴스를 엑티비티 View 계층 구조 안에 삽입합니다. 여기서 사용된 Fragment 는 ListFragment 를  상속받아 작성되었으며 아이템 목록을 관리하고 화면상에 출력합니다.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: arial, sans-serif; font-size: 13px; line-height: normal;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot; style=&quot;background-color: #fafafa; border-bottom: rgb(204,204,204) 1px solid; border-left: rgb(204,204,204) 1px solid; border-right: rgb(204,204,204) 1px solid; border-top: rgb(204,204,204) 1px solid; color: #007000; font-family: monospace; margin: 0px 0px 1em 1em; overflow-x: auto; overflow-y: auto; padding-bottom: 10px; padding-left: 10px; padding-right: 10px; padding-top: 10px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: arial, sans-serif; font-size: 13px; line-height: normal;&quot;&gt;&lt;code style=&quot;color: #007000; font-family: monospace; line-height: 1em;&quot;&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; font-size: 9pt;&quot;&gt;public&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; font-size: 9pt;&quot;&gt;static&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; font-size: 9pt;&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #660066; font-size: 9pt;&quot;&gt;TitlesFragment&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; font-size: 9pt;&quot;&gt;extends&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #660066; font-size: 9pt;&quot;&gt;ListFragment&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; font-size: 9pt;&quot;&gt;boolean&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; mDualPane&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; font-size: 9pt;&quot;&gt;int&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; mCurCheckPosition &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666; font-size: 9pt;&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;

&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666; font-size: 9pt;&quot;&gt;@Override&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; font-size: 9pt;&quot;&gt;public&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; font-size: 9pt;&quot;&gt;void&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; onActivityCreated&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #660066; font-size: 9pt;&quot;&gt;Bundle&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; savedState&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; font-size: 9pt;&quot;&gt;super&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;onActivityCreated&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;savedState&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;

&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;color: #880000; font-size: 9pt;&quot;&gt;// Populate list with our static array of titles.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; setListAdapter&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; font-size: 9pt;&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #660066; font-size: 9pt;&quot;&gt;ArrayAdapter&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #660066; font-size: 9pt;&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;&amp;gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;getActivity&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;(),&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; R&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;layout&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;simple_list_item_checkable_1&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #660066; font-size: 9pt;&quot;&gt;Shakespeare&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;TITLES&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;));&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;

&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;color: #880000; font-size: 9pt;&quot;&gt;// Check to see if we have a frame in which to embed the details&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;color: #880000; font-size: 9pt;&quot;&gt;// fragment directly in the containing UI.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #660066; font-size: 9pt;&quot;&gt;View&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; detailsFrame &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; getActivity&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;().&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;findViewById&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;R&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;details&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; mDualPane &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; detailsFrame &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;!=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; font-size: 9pt;&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; detailsFrame&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;getVisibility&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;==&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #660066; font-size: 9pt;&quot;&gt;View&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;VISIBLE&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;

&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; font-size: 9pt;&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;savedState &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;!=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; font-size: 9pt;&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;color: #880000; font-size: 9pt;&quot;&gt;// Restore last state for checked position.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; mCurCheckPosition &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; savedState&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;getInt&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;color: #008800; font-size: 9pt;&quot;&gt;&quot;curChoice&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666; font-size: 9pt;&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;

&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; font-size: 9pt;&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;mDualPane&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;color: #880000; font-size: 9pt;&quot;&gt;// In dual-pane mode, list view highlights selected item.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; getListView&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;().&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;setChoiceMode&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #660066; font-size: 9pt;&quot;&gt;ListView&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;CHOICE_MODE_SINGLE&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;color: #880000; font-size: 9pt;&quot;&gt;// Make sure our UI is in the correct state.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; showDetails&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;mCurCheckPosition&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;

&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666; font-size: 9pt;&quot;&gt;@Override&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; font-size: 9pt;&quot;&gt;public&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; font-size: 9pt;&quot;&gt;void&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; onSaveInstanceState&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #660066; font-size: 9pt;&quot;&gt;Bundle&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; outState&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; font-size: 9pt;&quot;&gt;super&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;onSaveInstanceState&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;outState&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; outState&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;putInt&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;color: #008800; font-size: 9pt;&quot;&gt;&quot;curChoice&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; mCurCheckPosition&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;

&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666; font-size: 9pt;&quot;&gt;@Override&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; font-size: 9pt;&quot;&gt;public&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; font-size: 9pt;&quot;&gt;void&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; onListItemClick&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #660066; font-size: 9pt;&quot;&gt;ListView&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; l&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #660066; font-size: 9pt;&quot;&gt;View&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; v&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; font-size: 9pt;&quot;&gt;int&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; pos&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; font-size: 9pt;&quot;&gt;long&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; id&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; showDetails&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;pos&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;

&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;color: #880000; font-size: 9pt;&quot;&gt;/**
&amp;nbsp; &amp;nbsp; &amp;nbsp;* Helper function to show the details of a selected item, either by
&amp;nbsp; &amp;nbsp; &amp;nbsp;* displaying a fragment in-place in the current UI, or starting a
&amp;nbsp; &amp;nbsp; &amp;nbsp;* whole new activity in which it is displayed.
&amp;nbsp; &amp;nbsp; &amp;nbsp;*/&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; font-size: 9pt;&quot;&gt;void&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; showDetails&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; font-size: 9pt;&quot;&gt;int&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; index&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; mCurCheckPosition &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; index&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;

&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; font-size: 9pt;&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;mDualPane&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;color: #880000; font-size: 9pt;&quot;&gt;// We can display everything in-place with fragments.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;color: #880000; font-size: 9pt;&quot;&gt;// Have the list highlight this item and show the data.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; getListView&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;().&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;setItemChecked&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;index&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; font-size: 9pt;&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;

&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;color: #880000; font-size: 9pt;&quot;&gt;// Check what fragment is shown, replace if needed.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #660066; font-size: 9pt;&quot;&gt;DetailsFragment&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; details &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #660066; font-size: 9pt;&quot;&gt;DetailsFragment&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; getFragmentManager&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;().&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;findFragmentById&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;R&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;details&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; font-size: 9pt;&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;details &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;==&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; font-size: 9pt;&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;||&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; details&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;getShownIndex&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;!=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; index&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;color: #880000; font-size: 9pt;&quot;&gt;// Make new fragment to show this selection.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; details &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #660066; font-size: 9pt;&quot;&gt;DetailsFragment&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;newInstance&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;index&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;

&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;color: #880000; font-size: 9pt;&quot;&gt;// Execute a transaction, replacing any existing&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;color: #880000; font-size: 9pt;&quot;&gt;// fragment with this one inside the frame.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #660066; font-size: 9pt;&quot;&gt;FragmentTransaction&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; ft
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; getFragmentManager&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;().&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;beginTransaction&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ft&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;replace&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;R&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;details&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; details&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ft&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;setTransition&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #660066; font-size: 9pt;&quot;&gt;FragmentTransaction&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;TRANSIT_FRAGMENT_FADE&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ft&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;commit&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;

&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; font-size: 9pt;&quot;&gt;else&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;color: #880000; font-size: 9pt;&quot;&gt;// Otherwise we need to launch a new activity to display&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;color: #880000; font-size: 9pt;&quot;&gt;// the dialog fragment with selected text.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #660066; font-size: 9pt;&quot;&gt;Intent&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; intent &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; font-size: 9pt;&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #660066; font-size: 9pt;&quot;&gt;Intent&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; intent&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;setClass&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;getActivity&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;(),&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #660066; font-size: 9pt;&quot;&gt;DetailsActivity&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; font-size: 9pt;&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; intent&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;putExtra&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;color: #008800; font-size: 9pt;&quot;&gt;&quot;index&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; index&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; startActivity&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;intent&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 2;&quot;&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 13px;&quot;&gt;&amp;nbsp;구현 내용을 살펴보시면, UI 레이아웃 상에, 선택된  아이템의 상세 정보를 표시할 수 있는 &#39;details&#39; 라는 ID 의 View 가 존재하는지 여부에 따라, 상세 정보를 현재 엑티비티 내에서  모두 표현할지, 아니면 별도의 엑티비티를 호출하여 표현할지 구분되어 구현되어있음을 확인 하실 수 있습니다. 또, Fragment 인스턴스의  정보는 프레임워크 내에서 자동으로 저장 관리되기 때문에, newInstance() 메서드를 통해 생성된 DetailsFragment 인스턴스를  별다른 관리 없이 FragmentManager 의 findFragmentById 메서드를 통해 재활용해 사용하고  있습니다.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 2;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 13px; line-height: 26px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 2;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 13px; line-height: 26px;&quot;&gt;&amp;nbsp;선택된 아이템 상세 정보를 표현하기 위한 Details첫 화면을  위해서 DetailsFragment 는 주어진 문자열을 TextView 로 출력하는 역할을 수행합니다. 다음과 같이 간단하게 구현할 수  있습니다.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 13px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 26px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: arial, sans-serif; font-size: 13px; line-height: normal;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot; style=&quot;background-color: #fafafa; border-bottom: rgb(204,204,204) 1px solid; border-left: rgb(204,204,204) 1px solid; border-right: rgb(204,204,204) 1px solid; border-top: rgb(204,204,204) 1px solid; color: #007000; font-family: monospace; margin: 0px 0px 1em 1em; overflow-x: auto; overflow-y: auto; padding-bottom: 10px; padding-left: 10px; padding-right: 10px; padding-top: 10px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 13px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 26px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: arial, sans-serif; font-size: 13px; line-height: normal;&quot;&gt;&lt;code style=&quot;color: #007000; font-family: monospace; line-height: 1em;&quot;&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; font-size: 9pt;&quot;&gt;public&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; font-size: 9pt;&quot;&gt;static&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; font-size: 9pt;&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #660066; font-size: 9pt;&quot;&gt;DetailsFragment&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; font-size: 9pt;&quot;&gt;extends&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #660066; font-size: 9pt;&quot;&gt;Fragment&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;color: #880000; font-size: 9pt;&quot;&gt;/**
&amp;nbsp; &amp;nbsp; &amp;nbsp;* Create a new instance of DetailsFragment, initialized to
&amp;nbsp; &amp;nbsp; &amp;nbsp;* show the text at &#39;index&#39;.
&amp;nbsp; &amp;nbsp; &amp;nbsp;*/&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; font-size: 9pt;&quot;&gt;public&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; font-size: 9pt;&quot;&gt;static&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #660066; font-size: 9pt;&quot;&gt;DetailsFragment&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; newInstance&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; font-size: 9pt;&quot;&gt;int&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; index&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #660066; font-size: 9pt;&quot;&gt;DetailsFragment&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; f &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; font-size: 9pt;&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #660066; font-size: 9pt;&quot;&gt;DetailsFragment&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;

&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;color: #880000; font-size: 9pt;&quot;&gt;// Supply index input as an argument.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #660066; font-size: 9pt;&quot;&gt;Bundle&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; args &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; font-size: 9pt;&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #660066; font-size: 9pt;&quot;&gt;Bundle&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; args&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;putInt&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;color: #008800; font-size: 9pt;&quot;&gt;&quot;index&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; index&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; f&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;setArguments&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;args&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;

&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; font-size: 9pt;&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; f&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;

&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; font-size: 9pt;&quot;&gt;public&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; font-size: 9pt;&quot;&gt;int&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; getShownIndex&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; font-size: 9pt;&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; getArguments&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;().&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;getInt&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;color: #008800; font-size: 9pt;&quot;&gt;&quot;index&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666; font-size: 9pt;&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;
&amp;nbsp; &amp;nbsp; 
&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666; font-size: 9pt;&quot;&gt;@Override&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; font-size: 9pt;&quot;&gt;public&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #660066; font-size: 9pt;&quot;&gt;View&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; onCreateView&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #660066; font-size: 9pt;&quot;&gt;LayoutInflater&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; inflater&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #660066; font-size: 9pt;&quot;&gt;ViewGroup&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; container&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #660066; font-size: 9pt;&quot;&gt;Bundle&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; savedInstanceState&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; font-size: 9pt;&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;container &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;==&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; font-size: 9pt;&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;color: #880000; font-size: 9pt;&quot;&gt;// Currently in a layout without a container, so no&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;color: #880000; font-size: 9pt;&quot;&gt;// reason to create our view.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; font-size: 9pt;&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; font-size: 9pt;&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;

&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #660066; font-size: 9pt;&quot;&gt;ScrollView&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; scroller &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; font-size: 9pt;&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #660066; font-size: 9pt;&quot;&gt;ScrollView&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;getActivity&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;());&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #660066; font-size: 9pt;&quot;&gt;TextView&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; text &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; font-size: 9pt;&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #660066; font-size: 9pt;&quot;&gt;TextView&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;getActivity&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;());&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; font-size: 9pt;&quot;&gt;int&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; padding &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; font-size: 9pt;&quot;&gt;int&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #660066; font-size: 9pt;&quot;&gt;TypedValue&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;applyDimension&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #660066; font-size: 9pt;&quot;&gt;TypedValue&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;COMPLEX_UNIT_DIP&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666; font-size: 9pt;&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; getActivity&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;().&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;getResources&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;().&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;getDisplayMetrics&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;());&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; text&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;setPadding&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;padding&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; padding&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; padding&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; padding&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; scroller&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;addView&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;text&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; text&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;setText&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #660066; font-size: 9pt;&quot;&gt;Shakespeare&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;DIALOGUE&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;getShownIndex&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;()]);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; font-size: 9pt;&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; scroller&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 2;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 13px; line-height: 26px;&quot;&gt;&amp;nbsp;이제, 추가로 화면이 포트레이트 (세로) 모드일 때를 위한 새로운  UI 를 구성해 보겠습니다. 새로 모드의 경우, 두 개의 Fragment 를 나란히 배치할 공간이 부족하니, 이 경우에는 오직 아이템 목록만을  보여주고, 사용자가 아이템을 클릭하면 별도의 엑티비티에서 상세 정보를 보여주고자 합니다.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 2; text-align: center;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 13px; line-height: 26px;&quot;&gt;&lt;img id=&quot;_GTM_W5mVPTU/TUsiXt73RoI/AAAAAAAAAQ8/Jt6tXwJMrjw/s400/device-fragment-port1.png&quot; src=&quot;http://3.bp.blogspot.com/_GTM_W5mVPTU/TUsiXt73RoI/AAAAAAAAAQ8/Jt6tXwJMrjw/s400/device-fragment-port1.png&quot; style=&quot;cursor: pointer;&quot; /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;line-height: 2;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 13px; line-height: 26px;&quot;&gt;&amp;nbsp;사실 이 작업은, 지금까지 작성해둔 코드를 활용하면, 포트레이트  모드를 위하여 아래와 같은 레이아웃을 선언하면 끝입니다.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size:13px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 26px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: arial, sans-serif; font-size: 13px; line-height: normal;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot; style=&quot;background-color: #fafafa; border-bottom: rgb(204,204,204) 1px solid; border-left: rgb(204,204,204) 1px solid; border-right: rgb(204,204,204) 1px solid; border-top: rgb(204,204,204) 1px solid; color: #007000; font-family: monospace; margin: 0px 0px 1em 1em; overflow-x: auto; overflow-y: auto; padding-bottom: 10px; padding-left: 10px; padding-right: 10px; padding-top: 10px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 13px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 26px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: arial, sans-serif; font-size: 13px; line-height: normal;&quot;&gt;&lt;code style=&quot;color: #007000; font-family: monospace; line-height: 1em;&quot;&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088; font-size: 9pt;&quot;&gt;&amp;lt;FrameLayout&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;color: #882288; font-size: 9pt;&quot;&gt;xmlns:android&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800; font-size: 9pt;&quot;&gt;&quot;&lt;a class=&quot;con_link&quot; href=&quot;http://schemas.android.com/apk/res/android&quot; target=&quot;_blank&quot;&gt;http://schemas.android.com/apk/res/android&quot;&lt;/a&gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;color: #882288; font-size: 9pt;&quot;&gt;android:layout_width&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800; font-size: 9pt;&quot;&gt;&quot;match_parent&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;color: #882288; font-size: 9pt;&quot;&gt;android:layout_height&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800; font-size: 9pt;&quot;&gt;&quot;match_parent&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088; font-size: 9pt;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088; font-size: 9pt;&quot;&gt;&amp;lt;fragment&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;color: #882288; font-size: 9pt;&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800; font-size: 9pt;&quot;&gt;&quot;com.example.android.apis.app.TitlesFragment&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;color: #882288; font-size: 9pt;&quot;&gt;android:id&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800; font-size: 9pt;&quot;&gt;&quot;@+id/titles&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;color: #882288; font-size: 9pt;&quot;&gt;android:layout_width&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800; font-size: 9pt;&quot;&gt;&quot;match_parent&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;color: #882288; font-size: 9pt;&quot;&gt;android:layout_height&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;color: #008800; font-size: 9pt;&quot;&gt;&quot;match_parent&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088; font-size: 9pt;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;color: #000088; font-size: 9pt;&quot;&gt;&amp;lt;/FrameLayout&amp;gt;&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 13px; line-height: 26px;&quot;&gt;위  구현내용을 살펴보시면 알 수 있듯이, TitleFragment 는 아이템 상세 정보를 표시하기 위한 &#39;details&#39; ID 를 갖는 View 가  없는 경우 단지 아이템 목록만을 표시하고, 여러분 하나의 아이템을 선택할 때, 해당 아이템의 상세 정보를 담은 새로운 엑티비티를 표시하게 될 것  입니다.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 2; text-align: center;&quot;&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&lt;img id=&quot;_GTM_W5mVPTU/TUsipPriSTI/AAAAAAAAARE/-68jzx6xCII/s400/device-fragment-port2.png&quot; src=&quot;http://4.bp.blogspot.com/_GTM_W5mVPTU/TUsipPriSTI/AAAAAAAAARE/-68jzx6xCII/s400/device-fragment-port2.png&quot; style=&quot;cursor: pointer;&quot; /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;line-height: 2;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 13px; line-height: 26px;&quot;&gt;&amp;nbsp;이미 상세 정보를 출력하기 위해 DetailsFragment 를  구현하였기 때문에, 새로운 엑티비티도 손쉽게 작성할 수 있습니다.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 2;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 13px; line-height: 26px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: arial, sans-serif; line-height: normal;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot; style=&quot;background-color: #fafafa; border-bottom: rgb(204,204,204) 1px solid; border-left: rgb(204,204,204) 1px solid; border-right: rgb(204,204,204) 1px solid; border-top: rgb(204,204,204) 1px solid; color: #007000; font-family: monospace; margin: 0px 0px 1em 1em; overflow-x: auto; overflow-y: auto; padding-bottom: 10px; padding-left: 10px; padding-right: 10px; padding-top: 10px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 13px; line-height: 26px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: arial, sans-serif; line-height: normal;&quot;&gt;&lt;code style=&quot;color: #007000; font-family: monospace; line-height: 1em;&quot;&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; font-size: 9pt;&quot;&gt;public&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; font-size: 9pt;&quot;&gt;static&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; font-size: 9pt;&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #660066; font-size: 9pt;&quot;&gt;DetailsActivity&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; font-size: 9pt;&quot;&gt;extends&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #660066; font-size: 9pt;&quot;&gt;FragmentActivity&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;

&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666; font-size: 9pt;&quot;&gt;@Override&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; font-size: 9pt;&quot;&gt;protected&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; font-size: 9pt;&quot;&gt;void&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; onCreate&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #660066; font-size: 9pt;&quot;&gt;Bundle&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; savedInstanceState&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; font-size: 9pt;&quot;&gt;super&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;onCreate&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;savedInstanceState&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;

&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; font-size: 9pt;&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;getResources&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;().&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;getConfiguration&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;().&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;orientation
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;==&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #660066; font-size: 9pt;&quot;&gt;Configuration&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;ORIENTATION_LANDSCAPE&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;color: #880000; font-size: 9pt;&quot;&gt;// If the screen is now in landscape mode, we can show the&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;color: #880000; font-size: 9pt;&quot;&gt;// dialog in-line so we don&#39;t need this activity.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; finish&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; font-size: 9pt;&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;

&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; font-size: 9pt;&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;savedInstanceState &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;==&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; font-size: 9pt;&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;color: #880000; font-size: 9pt;&quot;&gt;// During initial setup, plug in the details fragment.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #660066; font-size: 9pt;&quot;&gt;DetailsFragment&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; details &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088; font-size: 9pt;&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #660066; font-size: 9pt;&quot;&gt;DetailsFragment&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; details&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;setArguments&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;getIntent&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;().&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;getExtras&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;());&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; getSupportFragmentManager&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;().&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;beginTransaction&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;().&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;add&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; android&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;R&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;content&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt; details&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;commit&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black; font-size: 9pt;&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600; font-size: 9pt;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 2;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 13px; line-height: 26px;&quot;&gt;&amp;nbsp;작업이 완료되었습니다. 우리는 새로운 Fragment API 를  이용하여, 화면 모드가 변함에 따라 UI 플로우가 완전히 변경되는 온전한 어플리케이션 예제를 만들었습니다.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 13px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 26px;&quot;&gt;&amp;nbsp;지금까지 예제를 통해 Fragment 를 활용하여 UI 를 변경할 수 있는 한 가지 방법을  설명했습니다. 여러분의 어플리케이션 디자인에 따라서, 다양한 방식으로 이를 활용할 수도 있습니다. 예를 들어, 여러분은 전체 어플리케이션을  하나의 엑티비티에 담고, 엑티비티의 상태가 변함에 따라 내부 Fragment 의 구조만을 변경하는 방식으로 어플리케이션을 작성할 수도 있을 것  입니다. 이런경우, Fragment 가 자체적으로 &#39;back-stack&#39; 을 유지하고 있다는 사실이 큰 도움이 될 것  입니다.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 13px; line-height: 26px;&quot;&gt;&amp;nbsp;Fragment 와 FragmentManager API 에 관한  보다 상세한 정보는 안드로이드 3.0 SDK 문서에서 살펴보시거나, 리소스 항목 아래에 있는 ApiDemos 를 참조해 보셔도 좋습니다.  안드로이드 개발팀은 자유롭게 변환되는 UI 플로우, Fragment 다이얼로그, 리스트, 메뉴 생성, 엑티비티 인스턴스간에 Fragment  인스턴스를 유지하기, &#39;back-stack&#39; 등등 &lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 13px; line-height: 26px;&quot;&gt;다양한 예제 코드를 마련해 두었습니다.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;line-height: 2;&quot;&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&lt;b&gt;Fragmentation for  all!&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 13px; line-height: 26px;&quot;&gt;&amp;nbsp;안드로이드 3.0 기반의 태블릿 용 어플리케이션 개발자들은 새로운  Fragment API 를 이용하여, 큰 화면에 따른 다양한 UI 설계 문제를 보다 잘 처리하실 수 있을 것 입니다. 거기에 덧붙여 만일에,  Fragment 를 잘 활용한다면, 향후 등장할 새로운 안드로이드 디바이스 - 휴대폰, TV 등등 에 맞추어 여러분의 어플리케이션 UI 를 쉽게  변경할 수 있을 것 입니다.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 13px; line-height: 26px;&quot;&gt;&amp;nbsp;하지만, 바로 오늘 이 순간에는 많은 개발자들이 현재 존재하는  휴대폰 용 어플리케이션을 작성하고 있으며, 해당 &amp;nbsp;어플리케이션이 타블렛 상에서는 보다 향상된 UI 요소를 활용할 수 있으면 얼마나 좋을까...  하고 생각하고 계실 것 입니다. 현재 Fragment API 가 오직 안드로이드 3.0 에서만 지원되고 있다는 사실을 생각해보면, 이는 참으로  안타까운 일 입니다.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;line-height: 2;&quot;&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&amp;nbsp;이런 문제를 해결하기 위하여,  안드로이드 개발팀은 이 포스트에서 이야기한 Fragment API 를 기존의 안드로이드 플랫폼에서도 활용 할 수 있도록 Static 라이브러리  형태로 제공할 예정입니다. 현재 계획으로는 1.6 이후의 모든 플랫폼을 지원하고자 하며, 사실 여러분이 이 포스트에서 사용된 코드는 바로 그러한  Static 라이브러리를 활용하여 작성되었습니다. 눈치가 빠른 분들이라면 스크린샷으로도 확인하실 수 있었겠지요. 현재, 우리의 목표는  Static 라이브러리에서 제공하는 API 와 안드로이드 3.0 플랫폼에서 제공하는 API 를 최대한 동일하게 만드는 것이며, 여러분이 지금  즉시 Fragment API 를 활용하고, 향후 안드로이드 3.0 을 사용하실 때도, 기존 어플리케이션 코드를 거의 변경하지 않고 적용할 수  있도록 만들고자 합니다.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;line-height: 2;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 26px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 13px;&quot;&gt;&amp;nbsp;Fragment API 를  위한&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 13px; line-height: 26px;&quot;&gt;Static 라이브러리를 제공하는 날짜가 아직 확정되지는  않았지만, 생각보다 이른 시간내에 공개할 것이라고는 말씀드릴 수 있습니다. 그 사이에 여러분은 안드로이드 3.0 SDK 를 이용하여  Fragment API 를 어떤식으로 활용할 수 있는지 테스트해보실 수 있으며, 그 노력은 결코 헛되지 않을 것 입니다.&lt;/span&gt;&amp;nbsp; &lt;br /&gt;
&lt;div class=&quot;autosourcing-stub&quot;&gt;&lt;div style=&quot;font-family: Dotum; font-size: 12px; font-style: normal; font-weight: normal; margin: 11px 0px 7px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;strong style=&quot;padding-bottom: 0px; padding-left: 0px; padding-right: 7px; padding-top: 0px;&quot;&gt;[출처]&lt;/strong&gt;  &lt;a href=&quot;http://blog.naver.com/huewu/110102599243&quot; target=&quot;_blank&quot;&gt;[번역] The  Android 3.0 Fragments API&lt;/a&gt;&lt;span style=&quot;padding-bottom: 0px; padding-left: 5px; padding-right: 7px; padding-top: 0px;&quot;&gt;|&lt;/span&gt;&lt;strong style=&quot;padding-bottom: 0px; padding-left: 0px; padding-right: 7px; padding-top: 0px;&quot;&gt;작성자&lt;/strong&gt;  &lt;a href=&quot;http://blog.naver.com/huewu&quot; target=&quot;_blank&quot;&gt;휴우&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bridroid.blogspot.com/feeds/4323375996446868092/comments/default' title='댓글'/><link rel='replies' type='text/html' href='http://bridroid.blogspot.com/2011/04/android-30-fragments-api.html#comment-form' title='0개의 덧글'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/905901812770512183/posts/default/4323375996446868092'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/905901812770512183/posts/default/4323375996446868092'/><link rel='alternate' type='text/html' href='http://bridroid.blogspot.com/2011/04/android-30-fragments-api.html' title='[번역] The Android 3.0 Fragments API'/><author><name>brith1225</name><uri>http://www.blogger.com/profile/15293023387175369557</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/_GTM_W5mVPTU/TUsiB0_SZiI/AAAAAAAAAQ0/FtxDiayMsN8/s72-c/device-fragment-land.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-905901812770512183.post-5500089115090502594</id><published>2011-04-07T16:54:00.000-07:00</published><updated>2014-07-17T01:33:15.063-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="android"/><title type='text'>android market 에 등록된 어플 QR 코드 자동 생성</title><content type='html'>android market 에 등록된 어플 QR 코드 자동 생성&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://kr.androlib.com/&quot;&gt;http://kr.androlib.com/&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;lt;- 여기서 어플 검색하면&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
오른쪽에 QR 코드 자동 생성</content><link rel='replies' type='application/atom+xml' href='http://bridroid.blogspot.com/feeds/5500089115090502594/comments/default' title='댓글'/><link rel='replies' type='text/html' href='http://bridroid.blogspot.com/2011/04/android-market-qr.html#comment-form' title='0개의 덧글'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/905901812770512183/posts/default/5500089115090502594'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/905901812770512183/posts/default/5500089115090502594'/><link rel='alternate' type='text/html' href='http://bridroid.blogspot.com/2011/04/android-market-qr.html' title='android market 에 등록된 어플 QR 코드 자동 생성'/><author><name>brith1225</name><uri>http://www.blogger.com/profile/15293023387175369557</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-905901812770512183.post-5050243921140350710</id><published>2011-04-07T03:29:00.000-07:00</published><updated>2014-07-17T01:33:15.059-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="android"/><title type='text'>방사능 수치 실시간 조회 app</title><content type='html'>&lt;a href=&quot;https://market.android.com/details?id=com.jinsungyun.radiationlevel&quot;&gt;https://market.android.com/details?id=com.jinsungyun.radiationlevel&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;doc-overview&quot; style=&quot;-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; border-bottom-width: 0px; border-collapse: collapse; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: #666666; font-family: &#39;Droid Sans&#39;, Arial, sans-serif; font-size: 13px; line-height: 18px; margin-bottom: 0px; margin-left: 0px; margin-right: 120px; margin-top: 0px; padding-bottom: 20px; padding-left: 0px; padding-right: 22px; padding-top: 0px;&quot;&gt;&lt;h2 style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: #7b9726; font-size: 21px; font-weight: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 10px; padding-top: 0px; text-transform: uppercase;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; border-collapse: separate; color: #333333; font-family: Verdana, Tahoma, Arial, Helvetica, sans-serif; font-size: 13px; font-weight: bold; line-height: 19px; text-transform: none;&quot;&gt;&lt;img height=&quot;135&quot; src=&quot;http://chart.apis.google.com/chart?cht=qr&amp;amp;chs=135x135&amp;amp;chl=market%3a%2f%2fdetails%3fid%3dcom.jinsungyun.radiationlevel%26referrer%3dutm_source%253DAndrolib%2526utm_medium%253DPage%2526utm_campaign%253DAndrolib%2520Page&quot; style=&quot;border-bottom-style: none; border-color: initial; border-left-style: none; border-right-style: none; border-top-style: none; border-width: initial;&quot; width=&quot;135&quot; /&gt;&lt;/span&gt; &lt;/h2&gt;&lt;h2 style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: #7b9726; font-size: 21px; font-weight: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 10px; padding-top: 0px; text-transform: uppercase;&quot;&gt;&lt;br /&gt;
&lt;/h2&gt;&lt;h2 style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: #7b9726; font-size: 21px; font-weight: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 10px; padding-top: 0px; text-transform: uppercase;&quot;&gt;&lt;br /&gt;
&lt;/h2&gt;&lt;h2 style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: #7b9726; font-size: 21px; font-weight: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 10px; padding-top: 0px; text-transform: uppercase;&quot;&gt;설명&lt;/h2&gt;&lt;div class=&quot;&quot; id=&quot;doc-description-container&quot; style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;div class=&quot;doc-description toggle-overflow-contents&quot; style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; line-height: 1.5em; margin-bottom: 1em; margin-left: 0px; margin-right: 0px; margin-top: 1em; overflow-x: auto; overflow-y: auto; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;div id=&quot;doc-original-text&quot; style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;우리나라와 일본지역의 방사능 수치를 실시간 조회합니다.&lt;br /&gt;
&lt;div style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 1em; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;문제있을시 메일보내주시면 다음버전에 반영하겠습니다.&lt;/div&gt;&lt;div style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 1em; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;감사합니다.&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;doc-description-overflow&quot; style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;doc-description-show-all&quot; style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-color: rgb(215, 215, 215); border-top-style: solid; border-top-width: 1px; margin-bottom: 0.75em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; position: relative;&quot;&gt;&lt;/div&gt;&lt;a href=&quot;http://www.google.com/url?q=http://bridroid.blogspot.com&amp;amp;usg=AFQjCNEHcLlxs-bcCxSpfOOkFtVeYjBuBg&quot; rel=&quot;nofollow&quot; style=&quot;color: #3d3d3d; text-decoration: none;&quot; target=&quot;_blank&quot;&gt;개발자 웹사이트 방문&lt;span class=&quot;more-arrow&quot; style=&quot;color: #4db8ca; font-size: 20px; padding-left: 4px;&quot;&gt;›&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;doc-overview-screenshots&quot; style=&quot;-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; border-bottom-width: 0px; border-collapse: collapse; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: #666666; font-family: &#39;Droid Sans&#39;, Arial, sans-serif; font-size: 13px; line-height: 18px; margin-bottom: 0px; margin-left: 0px; margin-right: 140px; margin-top: 0px; padding-bottom: 20px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;h2 style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: #7b9726; font-size: 21px; font-weight: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 10px; padding-top: 0px; text-transform: uppercase;&quot;&gt;애플리케이션 캡쳐화면&lt;/h2&gt;&lt;div class=&quot;doc-screenshot-section&quot; style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; margin-bottom: 36px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 10px;&quot;&gt;&lt;div class=&quot;carousel-mini doc-screenshot-carousel-pages&quot; style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;div class=&quot;carousel-pages&quot; style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; height: 227px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; overflow-x: hidden; overflow-y: hidden; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; position: relative; width: 450px;&quot;&gt;&lt;div class=&quot;carousel-pages-wrapper&quot; style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; left: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; position: absolute; width: 10000px;&quot;&gt;&lt;div class=&quot;carousel-page&quot; style=&quot;border-bottom-color: rgb(215, 215, 215); border-bottom-style: solid; border-bottom-width: 1px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; float: left; height: 226px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; width: 450px;&quot;&gt;&lt;img class=&quot;doc-screenshot-img lightbox&quot; src=&quot;https://ssl.gstatic.com/android/market/com.jinsungyun.radiationlevel/ss-0-320-480-160-0-bbed7ab56252fd8f1ad48ff7a1124f7f6d0ce1b7&quot; style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; cursor: pointer; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 18px; padding-left: 10px; padding-right: 0px; padding-top: 0px; vertical-align: top; width: 138px;&quot; title=&quot;방사능 수치 실시간 조회&quot; /&gt;&lt;img class=&quot;doc-screenshot-img lightbox&quot; src=&quot;https://ssl.gstatic.com/android/market/com.jinsungyun.radiationlevel/ss-1-320-480-160-0-2634b6aee7bf23c675868da4c7b55ad292039414&quot; style=&quot;border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; cursor: pointer; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 18px; padding-left: 10px; padding-right: 0px; padding-top: 0px; vertical-align: top; width: 138px;&quot; title=&quot;방사능 수치 실시간 조회&quot; /&gt;&lt;/div&gt;&lt;div class=&quot;carousel-page&quot; style=&quot;border-bottom-color: rgb(215, 215, 215); border-bottom-style: solid; border-bottom-width: 1px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; float: left; height: 226px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; width: 450px;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bridroid.blogspot.com/feeds/5050243921140350710/comments/default' title='댓글'/><link rel='replies' type='text/html' href='http://bridroid.blogspot.com/2011/04/blog-post.html#comment-form' title='0개의 덧글'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/905901812770512183/posts/default/5050243921140350710'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/905901812770512183/posts/default/5050243921140350710'/><link rel='alternate' type='text/html' href='http://bridroid.blogspot.com/2011/04/blog-post.html' title='방사능 수치 실시간 조회 app'/><author><name>brith1225</name><uri>http://www.blogger.com/profile/15293023387175369557</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-905901812770512183.post-3457552361544290067</id><published>2011-03-27T22:25:00.001-07:00</published><updated>2014-07-17T01:33:15.052-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="android"/><title type='text'>노래방 번호 검색 App</title><content type='html'>&lt;div class=&quot;doc-overview&quot; style=&quot;-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; border-bottom-width: 0px; border-collapse: collapse; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; font-family: &amp;quot;Droid Sans&amp;quot;, Arial, sans-serif; line-height: 18px; margin: 0px 120px 0px 0px; padding-bottom: 20px; padding-left: 0px; padding-right: 22px; padding-top: 0px;&quot;&gt;&lt;h2 style=&quot;border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; color: #7b9726; font-size: 21px; margin: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 10px; padding-top: 0px; text-transform: uppercase;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; border-collapse: separate; color: black; font-family: Gulim; font-size: small; font-weight: normal; line-height: normal; text-transform: none;&quot;&gt;&lt;a href=&quot;https://market.android.com/details?id=com.jinsungyun.songapp&amp;amp;feature=search_result&quot; target=&quot;_blank&quot;&gt;https://market.android.com/details?id=com.jinsungyun.songapp&amp;amp;feature=search_result&lt;/a&gt;&lt;/span&gt;&lt;/h2&gt;&lt;h2 style=&quot;border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; color: #7b9726; font-size: 21px; margin: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 10px; padding-top: 0px; text-transform: uppercase;&quot;&gt;&lt;br /&gt;
&lt;/h2&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjJWKvNxPBwo_0ClV__jXJKKeHcFoWvGByg2xIZIwu-ehb8WHEdb34uJ8rWsJ_1h1NixyrSgk5cbwy6UARQZjlb8dsnjewW4ksEh7kIaDGt3ImoB5UR4AphgsHAJDDle8dpcPGWWZTLbWm1/s1600/chart.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; r6=&quot;true&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjJWKvNxPBwo_0ClV__jXJKKeHcFoWvGByg2xIZIwu-ehb8WHEdb34uJ8rWsJ_1h1NixyrSgk5cbwy6UARQZjlb8dsnjewW4ksEh7kIaDGt3ImoB5UR4AphgsHAJDDle8dpcPGWWZTLbWm1/s320/chart.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;h2 style=&quot;border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; color: #7b9726; font-size: 21px; margin: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 10px; padding-top: 0px; text-transform: uppercase;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; border-collapse: separate; color: #333333; font-family: 나눔고딕, NanumGothic, 돋움, Dotumt, 굴림, Gulim, AppleGothic, sans-serif; font-size: 12px; font-weight: normal; line-height: 350px; text-transform: none;&quot;&gt;&lt;span style=&quot;color: #333333; font-family: 돋움, dotum, applegothic, sans-serif; font-size: 9pt; line-height: 18px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/h2&gt;&lt;h2 style=&quot;border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; color: #7b9726; font-size: 21px; margin: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 10px; padding-top: 0px; text-transform: uppercase;&quot;&gt;&lt;br /&gt;
&lt;/h2&gt;&lt;h2 style=&quot;border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; color: #7b9726; font-size: 21px; margin: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 10px; padding-top: 0px; text-transform: uppercase;&quot;&gt;설명&lt;/h2&gt;&lt;div id=&quot;doc-description-container&quot; style=&quot;border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; color: #666666; font-size: 13px; margin: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;div class=&quot;doc-description toggle-overflow-contents&quot; style=&quot;border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; line-height: 1.5em; margin: 1em 0px; overflow-x: auto; overflow-y: auto; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;div id=&quot;doc-original-text&quot; style=&quot;border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; margin: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;책 없이 노래방 번호를 검색합니다.(wifi or 3G)&lt;br /&gt;
태진노래방이 기준이고, 금영선택시 금영노래검색 가능합니다.&lt;br /&gt;
&lt;div style=&quot;border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; margin: 0px; padding-bottom: 1em; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;JPOP 검색은 한글 독음 과 일어 둘다 검색가능합니다&lt;/div&gt;&lt;div style=&quot;border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; margin: 0px; padding-bottom: 1em; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;검색 시 wifi or 3G 를 사용합니다.&lt;/div&gt;&lt;div style=&quot;border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; margin: 0px; padding-bottom: 1em; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;에러나 추가하고싶은 기능 있을시 메일 주시면, 업데이트 하겠습니다.&lt;/div&gt;&lt;div style=&quot;border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; margin: 0px; padding-bottom: 1em; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;감사합니다.&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;doc-description-overflow&quot; style=&quot;border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; margin: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;doc-description-show-all&quot; style=&quot;border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top: rgb(215,215,215) 1px solid; color: #666666; font-size: 13px; margin: 0px 0px 0.75em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; position: relative;&quot;&gt;&lt;/div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #7b9726; font-size: 21px; font-weight: bold; text-transform: uppercase;&quot;&gt;애플리케이션 캡쳐화면&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;doc-overview-screenshots&quot; style=&quot;-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; border-bottom-width: 0px; border-collapse: collapse; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; color: #666666; font-family: &amp;quot;Droid Sans&amp;quot;, Arial, sans-serif; font-size: 13px; line-height: 18px; margin: 0px 140px 0px 0px; padding-bottom: 20px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;div class=&quot;doc-screenshot-section&quot; style=&quot;border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; margin: 0px 0px 36px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 10px;&quot;&gt;&lt;div class=&quot;carousel-mini doc-screenshot-carousel-pages&quot; style=&quot;border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; margin: 0px; outline-style: none; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;div class=&quot;carousel-pages&quot; style=&quot;border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; height: 227px; margin: 0px; overflow-x: hidden; overflow-y: hidden; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; position: relative; width: 450px;&quot;&gt;&lt;div class=&quot;carousel-pages-wrapper&quot; style=&quot;border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; left: 0px; margin: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; position: absolute; width: 10000px;&quot;&gt;&lt;div class=&quot;carousel-page&quot; style=&quot;border-bottom: rgb(215,215,215) 1px solid; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; float: left; height: 226px; margin: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; width: 450px;&quot;&gt;&lt;img class=&quot;doc-screenshot-img&quot; src=&quot;https://ssl.gstatic.com/android/market/com.jinsungyun.songapp/ss-0-320-480-160-0-37cb819cba58c3e506523e483eaa5d349e7a2364&quot; style=&quot;border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; margin: 0px; padding-bottom: 18px; padding-left: 10px; padding-right: 0px; padding-top: 0px; vertical-align: top; width: 138px;&quot; title=&quot;노래방 번호검색&quot; /&gt;&lt;img class=&quot;doc-screenshot-img&quot; src=&quot;https://ssl.gstatic.com/android/market/com.jinsungyun.songapp/ss-1-320-480-160-0-c1895a18ab82723211ce2d4b289240ea07871738&quot; style=&quot;border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; margin: 0px; padding-bottom: 18px; padding-left: 10px; padding-right: 0px; padding-top: 0px; vertical-align: top; width: 138px;&quot; title=&quot;노래방 번호검색&quot; /&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; border-collapse: separate; color: black; font-family: Gulim; font-size: small; line-height: normal;&quot;&gt;&lt;a href=&quot;https://market.android.com/details?id=com.jinsungyun.songapp&amp;amp;feature=search_result&quot; target=&quot;_blank&quot;&gt;https://market.android.com/details?id=com.jinsungyun.songapp&amp;amp;feature=search_result&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bridroid.blogspot.com/feeds/3457552361544290067/comments/default' title='댓글'/><link rel='replies' type='text/html' href='http://bridroid.blogspot.com/2011/03/app.html#comment-form' title='0개의 덧글'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/905901812770512183/posts/default/3457552361544290067'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/905901812770512183/posts/default/3457552361544290067'/><link rel='alternate' type='text/html' href='http://bridroid.blogspot.com/2011/03/app.html' title='노래방 번호 검색 App'/><author><name>brith1225</name><uri>http://www.blogger.com/profile/15293023387175369557</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjJWKvNxPBwo_0ClV__jXJKKeHcFoWvGByg2xIZIwu-ehb8WHEdb34uJ8rWsJ_1h1NixyrSgk5cbwy6UARQZjlb8dsnjewW4ksEh7kIaDGt3ImoB5UR4AphgsHAJDDle8dpcPGWWZTLbWm1/s72-c/chart.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-905901812770512183.post-4541964588891895682</id><published>2011-03-23T20:50:00.001-07:00</published><updated>2014-07-17T01:33:15.057-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="android"/><title type='text'>Android app Market 등록(2. Market 등록)</title><content type='html'>&lt;div style=&quot;border-collapse: collapse; color: black; font-family: 굴림; font-size: 9pt; line-height: 1.5;&quot;&gt;1. 안드로이드마켓 개발자 사이트 접속&lt;/div&gt;&lt;div style=&quot;border-collapse: collapse; color: black; font-family: 굴림; font-size: 9pt; line-height: 1.5;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;border-collapse: collapse; color: black; font-family: 굴림; font-size: 9pt; line-height: 1.5;&quot;&gt;&lt;a href=&quot;http://market.android.com/publish/Home&quot; style=&quot;color: black; font-size: 12px; text-decoration: underline;&quot; target=&quot;_blank&quot;&gt;http://market.android.com/publish/Home&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;border-collapse: collapse; color: black; font-family: 굴림; font-size: 9pt; line-height: 1.5;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;border-collapse: collapse; color: black; font-family: 굴림; font-size: 9pt; line-height: 1.5;&quot;&gt;2. Upload Application 버튼을 클릭한다.&lt;/div&gt;&lt;div style=&quot;border-collapse: collapse; color: black; font-family: 굴림; font-size: 9pt; line-height: 1.5;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;border-collapse: collapse; color: black; font-family: 굴림; font-size: 9pt; line-height: 1.5;&quot;&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;img alt=&quot;&quot; class=&quot;chimg_photo&quot; height=&quot;386&quot; id=&quot;image_09433800554834306&quot; name=&quot;target_resize_image[]&quot; src=&quot;http://www.androidside.com/data/mw.cheditor/1101/QUvrQvXH.PNG&quot; style=&quot;border-bottom-width: 0px; border-color: initial; border-color: initial; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-style: initial; border-style: initial; border-top-width: 0px; cursor: pointer;&quot; width=&quot;600&quot; /&gt;&lt;/div&gt;&lt;br /&gt;
3. 업로드할 앱의 정보를 입력한다.&lt;/div&gt;&lt;div style=&quot;border-collapse: collapse; color: black; font-family: 굴림; font-size: 9pt; line-height: 1.5;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;border-collapse: collapse; font-family: 굴림; font-size: 12px; line-height: 20px;&quot;&gt;&lt;div style=&quot;color: black; font-family: 굴림; font-size: 9pt; line-height: 1.5; text-align: center;&quot;&gt;&lt;img alt=&quot;&quot; class=&quot;chimg_photo&quot; height=&quot;438&quot; id=&quot;image_019819019478745759&quot; name=&quot;target_resize_image[]&quot; src=&quot;http://www.androidside.com/data/mw.cheditor/1101/cZrAPyxyeJCWlOiQv4hZLdwsZxK.PNG&quot; style=&quot;border-bottom-width: 0px; border-color: initial; border-color: initial; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-style: initial; border-style: initial; border-top-width: 0px; cursor: pointer;&quot; width=&quot;600&quot; /&gt;&lt;/div&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: 굴림;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 9pt; line-height: 1.5;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 12px; line-height: 18px;&quot;&gt;Draft applicaion .apk file : 업로드할 앱의 파일을 선택한다.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;border-collapse: collapse; font-family: 굴림; font-size: 12px; line-height: 20px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: 굴림;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 12px; line-height: 18px;&quot;&gt;&amp;nbsp;&amp;nbsp;ScreenShots : 앱의 화면이미지를 선택한다.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;border-collapse: collapse; font-family: 굴림; font-size: 12px; line-height: 20px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: 굴림;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 12px; line-height: 18px;&quot;&gt;&amp;nbsp;&amp;nbsp;High Resolution Application Icon : 앱의 아이콘을 선택한다.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;border-collapse: collapse; font-family: 굴림; font-size: 12px; line-height: 20px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: 굴림;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 12px; line-height: 18px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;border-collapse: collapse; font-family: 굴림; font-size: 12px; line-height: 20px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: 굴림;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 12px; line-height: 18px;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;div style=&quot;font-size: 12px; line-height: 18px; text-align: center;&quot;&gt;&lt;img alt=&quot;&quot; class=&quot;chimg_photo&quot; height=&quot;438&quot; id=&quot;image_011928278510458767&quot; name=&quot;target_resize_image[]&quot; src=&quot;http://www.androidside.com/data/mw.cheditor/1101/ARntBqkttxoxyfmJgG.PNG&quot; style=&quot;border-bottom-width: 0px; border-color: initial; border-color: initial; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-style: initial; border-style: initial; border-top-width: 0px; cursor: pointer;&quot; width=&quot;600&quot; /&gt;&lt;/div&gt;&lt;div style=&quot;font-size: 12px; line-height: 18px; text-align: center;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;font-size: 12px; line-height: 18px; text-align: left;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;Language : &amp;nbsp;언어정보선택&lt;/div&gt;&lt;div style=&quot;font-size: 12px; line-height: 18px; text-align: left;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;Title : &amp;nbsp;앱의 명칭입력&lt;/div&gt;&lt;div style=&quot;font-size: 12px; line-height: 18px; text-align: left;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;Description : 설명입력&lt;/div&gt;&lt;div style=&quot;font-size: 12px; line-height: 18px; text-align: left;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 12px; line-height: 18px;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;div style=&quot;font-size: 12px; line-height: 18px; text-align: center;&quot;&gt;&lt;img alt=&quot;&quot; class=&quot;chimg_photo&quot; height=&quot;496&quot; id=&quot;image_008996475976891816&quot; name=&quot;target_resize_image[]&quot; src=&quot;http://www.androidside.com/data/mw.cheditor/1101/QnjcZD9qllzRUD24.PNG&quot; style=&quot;border-bottom-width: 0px; border-color: initial; border-color: initial; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-style: initial; border-style: initial; border-top-width: 0px; cursor: pointer;&quot; width=&quot;600&quot; /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 12px; line-height: 18px;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 12px; line-height: 18px;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #a5c739; font-family: Arial, sans-serif; font-size: 15px; font-weight: bold;&quot;&gt;Publishing options&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #a5c739; font-family: Arial, sans-serif; font-size: 15px; font-weight: bold;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #555555; font-family: Arial, sans-serif; font-size: 13px; font-weight: bold;&quot;&gt;Copy Protection : &amp;nbsp;복사 보호 여부&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #555555; font-family: Arial, sans-serif; font-size: 13px; font-weight: bold;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #555555; font-family: Arial, sans-serif; font-size: 13px; font-weight: bold;&quot;&gt;Content Rating &amp;nbsp;: &amp;nbsp;사용자 등급&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #555555; font-family: Arial, sans-serif; font-size: 13px; font-weight: bold;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #555555; font-family: Arial, sans-serif; font-size: 13px; font-weight: bold;&quot;&gt;Locations : 지역선택&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #555555; font-family: Arial, sans-serif; font-size: 13px; font-weight: bold;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #555555; font-family: Arial, sans-serif; font-size: 13px; font-weight: bold;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;Publish 버튼을 누루면 안드로이드마켓 등록 완료&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #555555; font-family: Arial, sans-serif; font-size: 13px; font-weight: bold;&quot;&gt;(출처:androidside)&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bridroid.blogspot.com/feeds/4541964588891895682/comments/default' title='댓글'/><link rel='replies' type='text/html' href='http://bridroid.blogspot.com/2011/03/android-app-market-2-market.html#comment-form' title='0개의 덧글'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/905901812770512183/posts/default/4541964588891895682'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/905901812770512183/posts/default/4541964588891895682'/><link rel='alternate' type='text/html' href='http://bridroid.blogspot.com/2011/03/android-app-market-2-market.html' title='Android app Market 등록(2. Market 등록)'/><author><name>brith1225</name><uri>http://www.blogger.com/profile/15293023387175369557</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>