You are on page 1of 55


Submitted By: JAYANT JONIA (0571043108) B.Tech(IT)/ASET/08 A dissertation submitted for partial fulfillment of the award of the degree of B.Tech (Information Technology)

Under the guidance of Mrs. RAKSHINDHA KUMARI Department of Information Technology Amity School of Engineering and Technology, NewDelhi Affiliated to Guru Gobind Singh Indraprastha University, Delhi Dwarka Sec 16C, New Delhi-110075 Website: (JUNE-JULY 2011)

S No.
1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12.

Table of Contents Certificate Acknowledgement Preface Company Profile Notepad in java Introduction Platform Description Source code Snapshots Future Scope And Enhancement Bibliography

2 3 4 5 6 19 20 26 31 45 52 53



It is said that behind the accomplishment of any effort there are some dedicated individuals who give their best to get the job done. During the course of my project I came across many personalities and without their help and guidance I would not have been able to complete and present my project report in this form. First of all, I would like to express my deepest gratitude and sincere thanks to Mr. Vijay Thadani for his proper guidance and invaluable suggestions that were very much the heart and soul of the project. Secondly I would like to express my extreme thanks to my Project Manager Mrs. Rakshindha kumari who provided me the complete details of the project. He made me understand the exact requirements of our clients and also supervised my project throughout the six weeks. Last but not the least, I would like to thank my college authorities and all those who have been involved in the completion of this report.



0571043108 (14) B Tech. IT


Excellence is an attitude that the whole of the human race is born with. It is the environment that makes sure that whether the result of this attitude is visible or otherwise. The well planned, properly executed and evaluated industrial training help a lot in including the good work culture. It provides linkage between the student and industry in order to develop the awareness of industrial approach to problem solving based on broad understanding of the process and of operation of an organization. During this period, the students get their first real hand experience on working in the real environment. Most of the theoretical knowledge that they have gained during the course of their studies is put to test here. Apart from this the students get the opportunity to learn the latest technology, which immensely help them in their career. This also benefits the organization as many students doing their projects perform very well and henceforth are offered a job in the same company. I had the opportunity to have the real practical experience, which has increased my sphere of knowledge to a great extent. Now, I am better equipped to handle the real problems effectively and efficiently. During the training period, I learnt how an actual project progresses, what sort of problems actually arise during the developments of such real time projects, how to design and produce quality products and so on. I really had great experience working with NIIT Technologies.



NIIT Limited



Traded as



Training & Education inInformation Technology IT services




Rajendra S. Pawar Vijay K. Thadani


Gurgaon, India NIIT Technologies in New Delhi, India

Key people

Rajendra S. Pawar
(Chairman & MD)

Vijay K. Thadani


BPO, Application Development Management, Managed Service, Package Implementation, Platform Based Services[1]


$224.1 million (FY 2009)[2]


3,641 (2009)[2]


NIIT SofTec NIIT ROOM Solutions Element K



NIIT is a leading Global Talent Development Corporation, building skilled manpower pool for global industry requirements. The company which was set up in 1981, to help the nascent IT industry overcome its human resource challenges, has today grown to be amongst worlds leading talent development companies offering learning solutions to Individuals, Enterprises and Institutions across 40 countries. NIITs training solutions in and IT, Business Process and

Outsourcing, Banking, Finance and Insurance, Executive Management Education, Communication Professional Life Skills, touch five million learners every year. NIITs expertise in learning content development, training delivery and education process management make it the most preferred training partner, worldwide. Research-based Innovation, a key driver at NIIT, has enabled the organisation to develop programs and curricula that use cutting-edge instructional design methodologies and training delivery. NIITs Individual Learning Business offerings include industryendorsed programs for students seeking careers in IT New AgeGNIIT (Indias First Cloud Campus), Edgeineers and Global Net Plus for IT professionals. NIIT has provided computer-based learning to over 15,000 government and private schools. The futuristic NIITNGuru range for schools is a holistic education package that comprises Interactive Classrooms (an embedded Teaching Learning Material, that uses elements of interactivity, automation and web links library); Math lab(technology tools that enable school students to learn and explore mathematical concepts); IT Wizard(equips the students with core computer knowledge and IT skills); Quick School (an Education Resource Planning solution for school management); and Mobile Science 8

Lab (the first of its kind portable computerized Science Laboratory which enables students to correlate scientific concepts taught in the class to real life). To address the vast population of underserved, school-aged children, NIIT launched the Hole-in-the-Wall education initiative. Its achievements in the area of Minimally Invasive Education earned NIIT the coveted Digital Opportunity Award, by the World Information Technology Services Alliance (WITSA) in 2008. For working professionals, NIIT Imperia, Centre for Advanced Learning, offers Executive Management Education Programs in association with IIM Ahmadabad, IIM Calcutta, IIM Lucknow, IMT Ghaziabad and IIFT Delhi. NIIT Imperia also offers specialized courses in Finance in association with KPMG and on Digital Marketing with Google India and Internet and Mobile Association of India (IAMAI). NIIT Institute of Finance Banking & Insurance (IFBI), formed by NIIT with equity participation from ICICI Bank, offers programs for individuals and corporates in Banking, Financial Services and Insurance. NIIT Uniqua, Centre for Process Excellence, addresses the increasing demand for skilled workers in the business and technology services industry by providing training programs in relevant areas. This is a part of NIIT Institute of Process Excellence, a NIIT-Genpact venture. NIIT Careers@Campus, the companys Institutional Alliances Business for colleges and Universities, delivers in-campus training through Synchronous Learning Technology. NIITs Corporate Learning Solutions, NIITs Corporate Learning Solutions, offers integrated learning solutions (including strategic consulting, learning design, content development, delivery, technology, assessment and learning management) to Fortune 500 companies, Universities, Technology companies, Training corporations and Publishing houses.

NIIT delivers a tailored combination of catalog learning products, technology and services through Element K offerings. These include: vLab: hands-on labs, instructorled courseware, comprehensive e-reference libraries, technical journals, and KnowledgeHub: hosted learning management platform. This makes NIIT the first and the best choice for comprehensive learning solutions, worldwide. NIITs innovative HR practices have been felicitated by Aon Hewitt as amongst Top 25 Best Employers in India- 2011; Indian Education Awards 2011 as Best Education Company to Work with; by Great Places to Work Institute as amongst Top 25 Indias Best Companies to Work for and First in Training & Education Industry, 2011. Ushering in a new model in higher education is the not-for-profit NIIT University, established in 2009 with a vision of being the leading centre of innovation and learning in emerging areas of the Knowledge Society. Nestled in the foothills of Aravali, in Neemrana, Rajasthan, the picturesque 100 acres fully residential green campus has been developed as an institute of excellence based on the four core principles of providing industry linked, technology based, research driven, seamless education. NIIT offers a comprehensive range of learning solutions and services to address the needs of diverse audiences. We are today amongst worlds leading talent development companies offering learning solutions to individuals, enterprises and schools.. NIITs wide spectrum of services portfolio, comprising a mix of global solutions with a local flavor, are prevalent across varied domains. Driven by its vision of developing global talent, NIIT is helping to build a pool of employable, industry-ready professionals globally. NIIT together with Element K is the first and the best choice for worldwide. As one of the leading training companies, we offer diverse portfolio of programs in areas like, IT, ITES, BFSI, Management education, School education and Professional Life Skills. NIITs Individual Learning Solutions include industry-endorsed programs in


IT like- GNIIT, Integrated programs for Engineers (NIIT Edgeineers), Infrastructure Management programs(NIITGlobalNet+). We provide technology-based learning solutions to leading corporates across the world. NIIT offers cutting-edge learning solutions to Fortune 100 companies, universities, technology majors, training corporations and publishing houses. The companys expertise in areas like strategic consulting, learning design, customized content, off-theshelf content (e-learning),training delivery, hi-end technology training, testing & assessment, and learning management enables large organisations to train cost effectively and efficiently. It facilitates a learning environment that meets their existing and emerging skills requirements. At NIIT, we are committed to deliver high end solutions with the right blend of knowledge, skills and expertise. The gamut of services offered ensures a complete end to end solution for training needs of corporate.

Our venture in the Finance and Management Training (FMT) sector to address the learning needs of working professionals is an extension of our forte in IT training. NIIT Imperia, Centre for Advanced Learning, offers Executive Management Education Programmes in association with premier B schools in India.

Institute of Finance Banking & Insurance (IFBI), formed by NIIT with equity participation from ICICI Bank offers programs for individuals and corporates in Banking, Financial Services and Insurance. Building a training manpower pool for business and technology services industry through NIIT Uniqua, Centre for Process Excellence, is another significant move by NIIT. This is a part of NIIT Institute of Process Excellence (NIPE), a NIIT-Genpact venture. We have been working closely with global leaders in Technology to provide training on state-of-the-art technology platforms. Our strategic alliances with partners like Adobe,


Cisco, Comptia, EMC, Intel, Microsoft, Oracle, Prometric, SAS and Sun Microsystems ensures that the students capitalize on the latest skills and technology trends. NIITs School Learning Solutions offers turnkey IT integration program for schools and has provided computer-based learning to nearly 7.8 million students in over 9,500 government and private schools. We offer complete range of solutions for schools under the NIIT eGuru portfolio. The novel solution encompasses all the possible components required to service the present and future needs of a school, integrated into one package. Whether it is about imparting training in English Language & soft skills and offering School Learning Solutions or about fostering talent in rural or semi urban India through District Learning Centres (DLC), NIIT houses it all.



NIITs extensive delivery umbrella spread across 40 nations covers even the remotest parts of the globe and market segments. We have been providing learning solutions to individuals, institutions and enterprises by blending cutting-edge technology and education. Further strengthening NIIT's vision of developing global talent, are its enduring relationships with leaders in the technology and content space. NIIT works closely with global leaders such as Adobe, Cisco, Citrix, EMC, Intel, Microsoft, Oracle, SAS, Sun and provides training on their platforms. These relationships bring state-of-the-art learning solutions, courseware, and reference materials in the NIIT portfolio. At the same time, we are also leveraging our learning tieups with international partners to distribute training material worldwide.

Collaborations with over 100 leading academic institutions across India, China, New Zealand, UK, Malaysia, Australia, USA, Canada and Ireland facilitates global presence of famous NIIT inside model. These educational associations have enabled NIIT to provide locally relevant training to help nations build vital talent to empower the growth of various industries facing skilled manpower shortages. In line with these strategies, NIIT has emerged as a leading player in Nigeria, Ghana, Botswana, South Africa and as a most preferred IT training institute in China with over 170 centres in 24 provinces. NIIT through its subsidaries Element K, worlds second largest e-learning library and Cognitive Arts, caters to the corporate training markets of US and Europe . The company is also leveraging the high quality infrastructure, technology tools and faculty of the best Universities in the world. Our alliances facilitates an unmatched


delivery and unique educational experience that meets their existing needs and prepares them for the future. Great Place to Work Institute in association with Economic Times ranks NIIT as 1st in Education & Training Sector in Indias Best Companies to Work for 2011 study. NIIT ranked amongst the Top 25 list of Indias Best Companies to Work for 2011 by Great Place to Work Institute & Economic Times. NIIT ranked amongst the prestigious Top 25 list of Best Employers in India2011 by Aon Hewitt. NIIT adjudged as the Best Education Company to work with at Indian Education Awards 2011 by Franchise India. NIIT associated with Government of Gujarat in setting a New Guinness World Record of 20,480 Simultaneous Chess Players at Ahmedabad on December 24, 2010 under the guidance of World Chess Champion and NIIT MindChampion Viswanathan Anand. NIIT (USA) received the CLO Gold award for Virtual World Education, for the customized training solution put together for KFC in the US NIIT has been awarded Franchisor of the Year in Education: Information Technology in 2010 by Franchise Plus Magazine Element K wins the Brandon Hall Silver Excellence Award for blended learning NIIT (US) Accepts Honors for Learning and Talent Management Solution at Bersin Impact 2010 Conference NIIT (US) ranks amongst Top 10 Training & Learning Business Process Outsourcing Vendor in Black Book of Outsourcing NIIT HiWEL wins the prestigious Mac Arthur Digital Media and Learning Award NIIT MindChampion Viswanathan Anand became the World Chess Champion for the 4th time. NIITs association with World Chess Champion, Viswanathan Anand, including contractual extensions, is the longest running Brand Ambassador contract in the history of Indian sport


NIIT Vietnam bags the ICT GOLD MEDAL, consecutively for the 5th time and ICT TOP 5 for the year 2010 NIIT has been honoured as the - 'Most influential IT Training brand in China', on the eve of 60 years of Peoples Republic of China (PRC) celebrations NIIT USA has been awarded the Gold for Excellence in eLearning award by Chief Learning Officer (CLO) Magazine as part of its Learning in Practice Awards, one of the industrys highest honors for the second consecutive year

NIIT USA featured in Training magazine's Annual 'Top 125' List NIIT USA received Brandon Hall Excellence in eLearning Award 2009 Bronze for innovation in technology NIIT USA ranked among the Top 20 Companies in the Training Outsourcing Industry in 2009, by for the third consecutive year NIIT receives the prestigious CIO 100 Award 2009, presented by CIO Magazine (a part of the IDG group). The Award, in its fourth year in India, has been honouring exceptional work in IT leadership worldwide for the past 22 years

NIIT has received this recognition for the pioneering work done on revamping our NIIT was conferred the Top IT Training Company Award 2009 by the countrys leading publication group Cybermedia, the publisher of Dataquest. (NIIT has been getting this award successively for the past 16 years, since the inception of this category)

NIIT received the ICT Gold Medal Vietnam for the 4th year in a row in July 2009 NIIT received the Best Learning Partner award from CISCO and Microsoft in 2009 NIITs Institute of Finance, Banking and Insurance (IFBI) was recognized as the Best Training School by The Week Nielsen survey in 2009 NIIT received the Best Green IT Project award by PC Quest for V-lab in 2009 NIIT ICT enabled Learning Solutions bagged the following awards in the digital learning category at eIndia 2009, Indias Largest ICT event.


ICT Enabled School of the Year Award The Scindia School, Gwalior, Madhya Pradesh Civil society / Development agency Initiative of the year - Hole in the Wall Education Government / Policy Initiative of the year - Implementation of Shared Computing Technology in 5000 Govt. schools of Andhra Pradesh NIIT has been accorded the Business Superbrands 2008 status for the second time by the Superbrands Council NIIT recognized by UNESCO for innovation in ICT in Education in 2008 NIIT (HiWEL) has been conferred the coveted Digital Opportunity Award by World Information Technology Services Alliance (WITSA) in 2008 Ranked amongst Indias Most Trusted Services Brand in Economic Times Brand Equity survey in 2008 Ranked amongst Indias Most Respected Companies in the IT sector in a survey done by Business World magazine in 2007 NIIT was ranked as Indias Most Customer Responsive Educational Institution as per Avaya GlobalConnect Customer Responsiveness Awards in 2007 for the third consecutive year

The company was awarded the Indian Franchisor of the Year Award in 2007 by Franchising Association of India NIIT was ranked amongst the Top 10 Business Brands since 60 years of Independence, by a leading Indian magazine The Week in 2007 The company received the Award for Excellence in Innovative HR practices 2005 by Delhi Management Association and Watson Wyatt World NIIT is the only Indian Education company to be featured in The BCG 50 Local Dynamos

Slumdog Millionaire won the Oscars in 2009. The movie was based on the book Slumdog Millionaire (previously published as Q&A), written by Vikas Swarup. The author credits Hole-in-the-Wall Education Ltd. (HiWEL) as his inspiration for the book


Innovation has remained a growth catalyst for NIIT, leading us to think out-of-the-box, and bring to market products and training solutions that have often been global firsts. We have constantly transformed unique ideas into on-the-ground solutions that bring real benefits to learners. Our Franchisee network has earned us the soubriquet of McDonalds of the Training sector. One of the innovative solutions offered by NIIT is the synchronous learning based Executive Management programs from Indias top B schools through NIIT Imperia. The Industry-endorsed GNIIT curriculum has proved to be a trailblazing 12-month Professional Practice offering. Another epitome of novelty by NIIT was a breakthrough innovation in teaching strategies in schools for which it was honoured by UNESCO for innovation in ICT in Education. The leading Global Talent Development Corporation is committed to create a large pool of well trained, industry ready, worldclass IT professionals through its presence in 40 countries. The unique NIIT Inside model allows us to offer industry acclaimed IT training programs in partnership with Universities and Colleges in countries like China and Nigeria. Our focus and investments in Research have led to initiatives that have earned us global acclaim. The HiWELs revolutionary experiment of Minimally Invasive Education launched in 1999 and termed as Hole in the Wall by media, brings learning to the disadvantaged. The experiment proved that any set of children can acquire computing skills through incidental learning and access to suitable computing facilities, even in the absence of a direct input. Besides India, Hole in the Wall kiosks dot the landscape of countries such as Egypt, Vietnam, Uganda and South Africa, among others. Following the tradition of innovation, NIIT conceptualized Model District Learning Center at Chhindwara, to provide high quality IT training for graduates from semi-rural towns. Leadership in Global Talent Development In todays globalised, fast-changing world, the importance of Global Talent Development can not be underscored. With time, the demand for skilled talent is expected to grow faster. The existing skills shortages, along with issues such as the quality, reach and relevance of our education system, have huge ramifications for the Indian economy. However,


demographics are in Indias favour. As per a BCG study, by 2020 the world will have a shortage of 47 million working people and the Indian workforce will have a surplus of 56 million people. Whats needed is to develop skills, so that this surplus manpower is equipped to meet the needs of talent across geographies. Recognizing this opportunity NIITs mission is to attain leadership in Global Talent Development, by launching innovative, market-driven products and enhancing its reach globally. The Global Talent Development Corporation had set up its first overseas education centre in 1991 and today reaches out to 5 million learners across 40 countries. Our global presence facilitates cutting-edge Learning Solutions to Fortune 100 companies, universities, technology majors, training corporations and publishing houses through our subsidiary Element K. Through our subsidiary, CognitiveArts, we offer nearly three decades of experience and represent the highest achievement in research, education and experience in learning design architecture having developed over 300 innovative Experience Learning Solutions for major corporations and institutions.




Notepad is a simple text editor for Microsoft Windows. It has been included in all versions of Microsoft Windows since Windows 1.0 in 1985.


A component of Microsoft Windows

Notepad on Windows 7



Text editor

Included with

All Microsoft Windows versions

Related components



Notepad is a basic Windows utility. Its used for creating and/or editing unformatted text (.TXT) files. It has limitations, but its surprisingly useful - so much so that I always put a shortcut to it on my desktop. Notepad strips all formatting from text that is pasted into it. Boldface, italics, hyperlinks...all of it disappears, and you get the plain text instead. When youre copying and pasting in some applications (particularly Microsoft Office), theres a "Paste Special - Unformatted" option. Unfortunately this often fails to remove formatting, and the result can screw up your documents. By pasting the text into Notepad first, and then copying and pasting that Notepad text into your new document, you absolutely remove any and all text formatting - guaranteed clean text. Notepad is also useful for replacing characters which are wildcards to most Windows applications. For example, the asterisk is used as a general wildcard in most Windows applications (again, Office springs to mind). If you have a file which contains asterisks and you want to delete or replace them with a "Replace All", youre pretty much out of luck in Excel and Word. Searching and replacing * with nothing will delete all of your text. The same thing happens with the question mark, which is a wildcard that represents a single character (as opposed to the *, which can represent any number of characters). But Notepad doesnt use wildcards. So if you take your text and paste it into Notepad, you can search and replace all the *s or ?s, and then paste the text back into your original file. Of course, all other text formatting will have been removed too! But if you work with large Excel files (as I do) and sometimes get data with asterisks sprinkled throughout, Notepad is a godsend. Notepad is also handy to store a quick copy of any text. For example, say that Im writing a comment on a site that isnt always reliable. Or say that Im concerned that my connection to the net might crash. Its easy to pop open Notepad and throw a copy of my comment into it before hitting the "Submit" button. That way if something goes wrong, I


have a copy saved. And Notepad starts up more more quickly and uses far fewer system resources than Word. Because Notepad makes no changes to files that it opens (unless youmake changes, of course), its useful for examining and editing files which could be screwed up by more advanced programs. It can be used on HTML code quite nicely, for example. Likewise, if you have a file of unknown type because the extension has been deleted, opening it in Notepad is a good way to make sure that you dont screw it up merely by opening it. That way, you can example the contents of the file and possibly figure out what type of file it actually is. The file type name can often be found amongst the code at the beginning or end of the file. Older versions of Notepad did have a file size limitation. The WordPad utility was eventually added to Windows because of this; it has more features and can handle larger files. Notepad itself can now open and edit files of virtually any size, I believe (within hardware limitations, of course). Personally, I use Notepad every day, and havent used WordPad in years. As for whether or not you "need" it...well, it IS a basic Windows utility. I certainly wouldnt delete it, if I were you! But youll have to decide for yourself if you want to make use of it.

Notepad supports both left-to-right and right-to-left based languages, and one can alternate between these viewing formats by using the right or left Ctrl+Shift keys to go to right-to-left format or left-to-right format, respectively.

Unlike WordPad, Notepad does not treat newlines in Unix- or Mac-style text files correctly.


Early versions of Notepad offered only the most basic functions, such as finding text. Newer versions of Windows include an updated version of Notepad with a search and replace function (Ctrl + H), as well as Ctrl + F for search and similar keyboard shortcuts. Notepad makes use of a built-in window class named "EDIT". In older versions such as those included with Windows 95, Windows 98,Windows Me and Windows 3.1, there is a 64k limit on the size of the file being edited, an operating system limit of the EDIT class. Up to Windows 95, Fixedsys was the only available font for Notepad. Windows NT 4.0 and 98 introduced the ability to change this font. As ofWindows 2000, the default font was changed to Lucida Console. The font setting, however, only affects how the text is shown to the user, not how the file is saved to disk. Up to Windows Me, there were almost no keyboard shortcuts and no line-counting feature. Starting with Windows 2000, shortcuts for common tasks like new, open and save were added, as well as a status-bar with a line counter (available only when wordwrap is disabled). In the Windows NT-based versions of Windows, Notepad can edit traditional 8-bit text files as well as Unicode text files (both UTF-8 and UTF-16, and in case of UTF-16, both little-endian and big-endian). Notepad also has a simple built-in logging function. Each time a file that starts with .LOG is opened, the program inserts a text timestamp on the last line of the file.[1][2] Notepad accepts text from the Windows clipboard. When clipboard data with multiple formats is pasted into Notepad, the program will only accept text in the CF_TEXT format.[3] This is useful for stripping embedded font type and style codes from formatted text, such as when copying text from a web page and pasting into an email message or other WYSIWYG text editor. The formatted text is temporarily pasted into Notepad, and then immediately copied again in stripped format to be pasted into the other program. Simple text editors like Notepad may be used to edit text with markup, such as HTML. However, because they lack many features (such assyntax highlighting), web developers may favor more specialized editors for this purpose (see List of text editors).


Unicode detection The Windows NT version of Notepad, installed by default on Windows

2000 and Windows XP, has the ability to detect Unicode files even when they are missing a byte order mark. To do this, it utilizes a Windows API function called IsTextUnicode(). However, this function is imperfect, incorrectly identifying some all-lowercase ASCII text as UTF-16. As a result, Notepad interprets a file containing a phrase like "aaaa aaa aaa aaaaa" ("4-3-3-5") as two-byte Unicode text file and attempts to display it as such. If a font with support for Chinese is installed, nine Chinese characters are displayed; otherwise, it will display squares instead of Chinese characters. A few people misinterpreted this issue for an easter egg.[citation needed] Many phrases which fit the pattern (including this app can break, Bush hid the facts and acre vai pra globo) appeared on the web as hoaxes. Windows expert Raymond Chen correctly attributed it to the Unicode detection algorithm.[6] This issue has been resolved in the Windows Vista and Windows 7 versions of Notepad. Competing software Notepad does not require a lock on the file it opens, so it can open files already opened by other processes, users, or computers, whereas WordPad cannot. Also, since Notepad lacks advanced formatting functionality, many people find its simple interface faster and easier to use for basic text operations. The MS-DOS Editor, especially as updated in Windows 95, where it became an MDI application, also provides many features never offered by Notepad. There are many third-party replacements for Notepad with additional functionality, including both free software (e.g. Notepad++ and Notepad2) and freeware (e.g. TED Notepad). Notepad lacks many features available in other text editors, such as Unixformat newlines, code folding, regular expressions, macros, block-select, and MDI.


Minimum Hardware Requirement

Pentium Processor (Pentium 4 minimum) Minimum 128 MB RAM Recommended 512 GB RAM 15 Color Monitor

Software Configuration
JAVA Development Kit 1.6.0 JAVA Virtual Machine (JVM) WINDOWS 95/98/2000/XP/VISTA/7


Java is a programming language originally developed by James Gosling at Sun Microsystems(which is now a subsidiary of Oracle Corporation) and released in 1995 as a core component of Sun Microsystems' Java platform. The language derives much of its syntax from C and C++ but has a simpler object model and fewer low-level facilities. Java applications are typically compiledto bytecode (class file) that can run on any Java Virtual Machine (JVM) regardless of computer architecture. Java is a general-purpose, concurrent, class-based, object-oriented language that is specifically designed to have as few implementation dependencies as possible. It is intended to let application developers "write once, run anywhere." Java is currently one of the most popular programming languages in use, particularly for client-server web applications.[9][10] The original and reference implementation Java compilers, virtual machines, and class librarieswere developed by Sun from 1995. As of May 2007, in compliance with the specifications of theJava Community Process, Sun relicensed most of its Java technologies under the GNU General Public License. Others have also developed alternative implementations of these Sun technologies, such as the GNU Compiler for Java, GNU Classpath, and Dalvik.

Java Platform:
One characteristic of Java is portability, which means that computer programs written in the Java language must run similarly on any hardware/operating-system platform. This is 27

achieved by compiling the Java language code to an intermediate representation called Java bytecode, instead of directly to platform-specific machine code. Java bytecode instructions are analogous to machine code, but are intended to be interpreted by a virtual machine (VM) written specifically for the host hardware. Endusers commonly use a Java Runtime Environment(JRE) installed on their own machine for standalone Java applications, or in a Web browser for Java applets. Standardized libraries provide a generic way to access host-specific features such as graphics, threading, and networking. A major benefit of using bytecode is porting. However, the overhead of interpretation means that interpreted programs almost always run more slowly than programs compiled to native executables would. Just-in-Time compilers were introduced from an early stage that compile bytecodes to machine code during runtime.

Sun Microsystems officially licensed the Java Standard Edition platform for Linux,

Mac OS X,[22] and Solaris. In the past Sun licensed Java to Microsoft but the license

expired without renewal.[23] Because Windows does not ship with a Java software platform, a network of third-party vendors and licensees develop them for Windows and other operating system/hardware platforms. Sun's trademark license for usage of the Java brand insists that all implementations be "compatible". This resulted in a legal dispute with Microsoft after Sun claimed that the Microsoft implementation did not support RMI or JNI and had added platform-specific features of their own. Sun sued in 1997, and in 2001 won a settlement of US$20 million, as well as a court order enforcing the terms of the license from Sun.[25] As a result, Microsoft no longer ships Java with Windows, and in recent versions of Windows, Internet Explorer cannot support Java applets without a third-party plugin. Sun, and others, have made available free Java runtime systems for those and other versions of Windows. Platform-independent Java is essential to the Java EE strategy, and an even more rigorous validation is required to certify an implementation. This environment enables portable server-side applications, such as Web services, Java Servlets, and Enterprise JavaBeans, as well as withembedded systems based on OSGi, using Embedded Java environments. 28

Through the GlassFish project, Sun is working to create a fully functional, unified open source implementation of the Java EE technologies.Sun also distributes a superset of the JRE called the Java Development Kit (commonly known as the JDK), which includes development tools such as the Java compiler, Javadoc, Jar, and debugger.

Programs written in Java have a reputation for being slower and requiring more memory than those written in C. However, Java programs' execution speed improved significantly with the introduction of Just-in-time compilation in 1997/1998 for Java 1.1, the addition of language features supporting better code analysis (such as inner classes, StringBuffer class, optional assertions, etc.), and optimizations in the Java Virtual Machine itself, such as HotSpot becoming the default for Sun's JVM in 2000. Currently, Java 2.0 code had approximately half the performance of C code. However, Java 5.0 has been shown to run at native speeds that sometimes match and occasionally beat the speed of C and C++.Some platforms offer direct hardware support for Java; there are microcontrollers that can run Java in hardware instead of a software JVM, and ARM based processors can have hardware support for executing Java bytecode through its Jazelle option.

Automatic memory management:

Java uses an automatic garbage collector to manage memory in the object lifecycle. The programmer determines when objects are created, and the Java runtime is responsible for recovering the memory once objects are no longer in use. Once no references to an object remain, the unreachable memory becomes eligible to be freed automatically by the garbage collector. Something similar to a memory leak may still occur if a programmer's code holds a reference to an object that is no longer needed, typically when objects that are no longer needed are stored in containers that are still in use. If methods for a nonexistent object are called, a "null pointer exception" is thrown. One of the ideas behind Java's automatic memory management model is that programmers can be spared


the burden of having to perform manual memory management. In some languages, memory for the creation of objects is implicitly allocated on the stack, or explicitly allocated and deallocated from the heap. In the latter case the responsibility of managing memory resides with the programmer. If the program does not deallocate an object, a memory leak occurs. If the program attempts to access or deallocate memory that has already been deallocated, the result is undefined and difficult to predict, and the program is likely to become unstable and/or crash. This can be partially remedied by the use of smart pointers, but these add overhead and complexity. Note that garbage collection does not prevent "logical" memory leaks, i.e. those where the memory is still referenced but never used. Garbage collection may happen at any time. Ideally, it will occur when a program is idle. It is guaranteed to be triggered if there is insufficient free memory on the heap to allocate a new object; this can cause a program to stall momentarily. Explicit memory management is not possible in Java. Java does not support C/C++ style pointer arithmetic, where object addresses and unsigned integers (usually long integers) can be used interchangeably. This allows the garbage collector to relocate referenced objects and ensures type safety and security. As in C++ and some other object-oriented languages, variables of Java's primitive data types are not objects. Values of primitive types are either stored directly in fields (for objects) or on the stack (for methods) rather than on the heap, as commonly true for objects (but seeEscape analysis). This was a conscious decision by Java's designers for performance reasons. Because of this, Java was not considered to be a pure objectoriented programming language. However, as of Java 5.0, autoboxing enables programmers to proceed as if primitive types were instances of their wrapper class. Java contains multiple types of garbage collectors. By default, HotSpot uses the Concurrent Mark Sweep collector, also known as the CMS Garbage Collector. However, there are also several other garbage collectors that can be used to manage the Heap. For 90% of applications in Java, the CMS Garbage Collector is good enough.


The syntax of Java is largely derived from C++. Unlike C++, which combines the syntax for structured, generic, and object-oriented programming, Java was built almost exclusively as an object-oriented language. All code is written inside a class, and everything is an object, with the exception of the primitive data types (integers, floatingpoint numbers, boolean values, and characters), which are not classes for performance reasons. Unlike C++, Java does not support operator overloading or multiple

inheritance for classes. This simplifies the language and aids in preventing potential errors and anti-pattern design. Java uses similar commenting methods to C++. There are three different styles of comments: a single line style marked with two slashes (//), a multiple line style opened with /* and closed with */, and the Javadoc commenting style opened with /** and closed with */. The Javadoc style of commenting allows the user to run the Javadoc executable to compile documentation for the program.

// This is an example of a single line comment using two slashes /* This is an example of a multiple line comment using the slash and asterisk. This type of comment can be used to hold a lot of information or deactivate code but it is very important to remember to close the comment. */ /** * This is an example of a Javadoc comment; Javadoc can compile documentation * from this text. */ Examples: Hello world The traditional Hello world program can be written in Java as: 31

class HelloWorldApp { public static void main(String[] args) { System.out.println("Hello World!"); // Display the string. } }

import java.awt.Font; import java.awt.*; import java.awt.event.*; import java.awt.datatransfer.*; import*; import javax.swing.*; public class Editor extends JFrame implements ItemListener { String filename; TextArea tx; JTextField fromField,toField; JButton replaceButton; Clipboard clip = getToolkit().getSystemClipboard(); JLabel l1,l2,l3,withButton; JComboBox c1,c2,c3; String item1="serif",item2,item3; int size=12,item4=Font.PLAIN,start; String type_font[]={"Serif","SansSerif","Monospaced","Dialog","DialogInput"}; String font_style[]={"Regular","Bold","Italic","Bold Italic"};


String font_size[]={"8","9","10","12","16","18","20","22","24","26","28","36","48"," 72"}; Editor() { super("MY NOTEPAD"); l1=new JLabel("Font :"); l2=new JLabel("Font Style :"); l3=new JLabel("Size :"); c1=new JComboBox(type_font);

c1.setMaximumRowCount(4); c2=new JComboBox(font_style); c2.setMaximumRowCount(4); c3=new JComboBox(font_size); c3.setMaximumRowCount(4); fromField = new JTextField(8); toField = new JTextField(8); replaceButton = new JButton("Replace"); withButton = new JLabel("With"); setLayout(new GridLayout(1,2)); tx = new TextArea(); add(tx); MenuBar mb = new MenuBar(); Menu F = new Menu("file"); MenuItem n = new MenuItem("New"); MenuItem o = new MenuItem("Open"); MenuItem s = new MenuItem("Save");


MenuItem e = new MenuItem("Exit"); n.addActionListener(new New()); F.add(n); F.addSeparator(); o.addActionListener(new Open()); F.add(o); F.addSeparator(); s.addActionListener(new Save()); F.add(s); F.addSeparator(); e.addActionListener(new Exit()); F.add(e); mb.add(F); Menu E = new Menu("Edit"); MenuItem cut = new MenuItem("Cut"); MenuItem copy = new MenuItem("Copy"); MenuItem paste = new MenuItem("Paste"); MenuItem replace = new MenuItem("Replace"); cut.addActionListener(new Cut()); E.add(cut); E.addSeparator(); copy.addActionListener(new Copy()); E.add(copy); E.addSeparator(); paste.addActionListener(new Paste());


E.add(paste); E.addSeparator(); replace.addActionListener(new Replace()); E.add(replace); mb.add(E); Menu FT=new Menu("Format"); MenuItem Fnt=new MenuItem("Font"); FT.add(Fnt); mb.add(FT); Menu H=new Menu("Help"); MenuItem about=new MenuItem("About"); H.add(about); mb.add(H); Fnt.addActionListener(new FontClass()); c1.setEditable(true); c1.addItemListener(this); c2.addItemListener(this); c3.addItemListener(this); about.addActionListener(new About()); setMenuBar(mb); mylistener mylist = new mylistener(); addWindowListener(mylist); replaceButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt)


{ String from = fromField.getText(); start = tx.getText().indexOf(from); if (start>=0 && from.length() > 0) { tx.replaceRange(toField.getText(), start, start+ from.length()); } } }); setSize(500,400); setVisible(true); show(); } class FontClass implements ActionListener { JFrame frame; FontClass() { frame=new JFrame("Font"); frame.setLayout(new FlowLayout()); frame.add(l1); frame.add(c1); frame.add(l2); frame.add(c2); frame.add(l3); frame.add(c3);


frame.setSize(500,150); } public void actionPerformed(ActionEvent e) { frame.setVisible( true ); } } class mylistener extends WindowAdapter { public void windowClosing (WindowEvent e) { System.exit(0); } }

class New implements ActionListener { public void actionPerformed(ActionEvent e) { tx.setText(" "); setTitle(filename); } }

class Open implements ActionListener


{ public void actionPerformed(ActionEvent e) { FileDialog fd = new FileDialog(Editor.this, "select File",FileDialog.LOAD);; if (fd.getFile()!=null) { filename = fd.getDirectory() + fd.getFile(); setTitle(filename); ReadFile(); } tx.requestFocus(); } }

class Save implements ActionListener { public void actionPerformed(ActionEvent e) { FileDialog fd = new FileDialog(Editor.this,"Save File",FileDialog.SAVE);; if (fd.getFile()!=null) { filename = fd.getDirectory() + fd.getFile(); setTitle(filename);


try { DataOutputStream d = new DataOutputStream(new FileOutputStream(filename)); String line = tx.getText(); BufferedReader br = new BufferedReader(new StringReader(line)); while((line = br.readLine())!=null) { d.writeBytes(line + "\r\n"); } d.close(); } catch(Exception ex) { System.out.println("File not found"); } tx.requestFocus(); } } }

class Exit implements ActionListener { public void actionPerformed(ActionEvent e) { System.exit(0); 39

} } void ReadFile() { BufferedReader d; StringBuffer sb = new StringBuffer(); try { d = new BufferedReader(new FileReader(filename)); String line; while((line=d.readLine())!=null) sb.append(line + "\n"); tx.setText(sb.toString()); d.close(); } catch(FileNotFoundException fe) { System.out.println("File not Found"); } catch(IOException ioe) { } }

class Cut implements ActionListener { public void actionPerformed(ActionEvent e)


{ String sel = tx.getSelectedText(); StringSelection ss = new StringSelection(sel); clip.setContents(ss,null); tx.replaceRange("",(tx.getSelectionStart()-2),tx.getSelectionEnd()); } }

class Copy implements ActionListener { public void actionPerformed(ActionEvent e) { String sel = tx.getSelectedText(); StringSelection clipString = new StringSelection(sel); clip.setContents(clipString,clipString); } }

class Paste implements ActionListener { public void actionPerformed(ActionEvent e) { Transferable cliptran = clip.getContents(Editor.this); try {


String sel = (String) cliptran.getTransferData(DataFlavor.stringFlavor); tx.replaceRange(sel,tx.getSelectionStart(),tx.getSelectionEnd()); } catch(Exception exc) { System.out.println("not string flavour"); } } } class Replace implements ActionListener { JFrame frame1=new JFrame(); Replace() { frame1=new JFrame("Find & Replace"); frame1.setLayout(new FlowLayout()); frame1.add(replaceButton); frame1.add(fromField); frame1.add(withButton); frame1.add(toField); frame1.setSize(400,100); } public void actionPerformed(ActionEvent e) { frame1.setVisible( true );


} class About implements ActionListener { public void actionPerformed(ActionEvent e) { JOptionPane.showMessageDialog( null, " Version 2011 \n Basic Notepad \n Created By ...... JAYANT JONIA ", "NIIT NOTEPAD ",JOptionPane.PLAIN_MESSAGE ); } } public void itemStateChanged(ItemEvent e) { if(e.getSource()==c1) { item1=(String)c1.getSelectedItem(); tx.setFont(new Font(item1,Font.PLAIN,size)); show(); } if(e.getSource()==c2) { item2=(String)c2.getSelectedItem(); if(item2=="Regular") { tx.setFont(new Font(item1,Font.PLAIN,size));


show(); } else if(item2=="Bold") { tx.setFont(new Font(item1,Font.BOLD,size)); item4=Font.BOLD; show(); } else if(item2=="Italic") { tx.setFont(new Font(item1,Font.ITALIC,size)); item4=Font.ITALIC; show(); } else { tx.setFont(new Font(item1,Font.BOLD+Font.ITALIC,size)); item4=Font.BOLD+Font.ITALIC; show(); } } if(e.getSource()==c3) { item3=(String)c3.getSelectedItem(); size=Integer.valueOf(item3);


tx.setFont(new Font(item1,item4,size)); } }

public static void main(String args[]) { Editor eobj = new Editor(); } }

















At a later point of time if we plan to enhance our software. The following points would be given emphasis on: The features like syntax highlighting, Function list, Symbol database, Bracketmatching can be added. The Auto completion properties can also be provided. The facilities such as code folding and text folding would also be provided. The basic features of notepad like Spell checking, Regex-based find & replace, Encodingconversion, Newlineconversion, Multiple undo/redo, Rectangular block selection.



-The Complete Reference Java - Herbert Schildt -Programming with java Balagurusamy -Thinking in java- Bruce Eckel