Computer Science

Java

Java is a high-level, object-oriented programming language that is widely used for developing web and mobile applications, games, and other software. It was created by James Gosling at Sun Microsystems in the mid-1990s and is known for its platform independence, meaning that Java programs can run on any device or operating system that has a Java Virtual Machine installed.

Written by Perlego with AI-assistance

10 Key excerpts on "Java"

  • Book cover image for: 100+ Solutions in Java - 2nd Edition
    eBook - ePub

    100+ Solutions in Java - 2nd Edition

    Everything you need to know to develop Java applications (English Edition)

    The popularity of Java is on the rise even after more than two decades. Java is still the chosen language for the application of different domains and continues to advance at an accelerated pace. Java language can be used to develop a variety of applications, including:
    • Console-based and window-based desktop applications
    • Web applications with Web components such as Servlets, Java Server Pages (JSP ), Java Server Faces (JSF ), and so on. that are executed in a browser.
    • Enterprise applications with components such as Enterprise JavaBeans (EJB ) are used for distributed computing.
    • Web servers and application servers to host and deploy web and enterprise applications.
    • Apps that are created for small devices such as mobile phones.
    • Embedded software such as tiny chips, SIM cards, and so on. for electronic devices.
    • Scientific applications involving scientific calculations and mathematical operations. For example, applications like MATLAB use Java for interacting user interface as well as part of the core system.
    The applications can be created by using a simple text editor, for example, Notepad or by using an Integrated Development Environment (IDE ) that provides the necessary tools such as editor, compiler, debugger, and so on. for development of Java applications. The popular IDEs include NetBeans, Eclipse, IntelliJ, and Android Studio for mobile apps, and so on.
    1.10 Structure of a Java program
    Since Java is an object-oriented programming language, the development of an application in Java begins with the creation of a class. The definition of a class is saved in a file with the same name as the class name and a .Java extension. The structure and elements of a class are as shown below:
    Figure 1.14: Structure of a Java program
    The words depicted in bold font are keywords of Java language with a predefined meaning in the language. The keywords cannot be used for names of variables, methods, classes, or as any other identifier:
    • The package statement: A package in Java is similar to a namespace where classes of similar functionalities are saved. The package keyword is used to indicate that the succeeding text is the name of a package to which the class belongs. In Java, a class is always within a package. If no package is specified, the class belongs to the default package. Examples of built-in packages are Java.swing, Java.io , and so on. The classes related to GUI are stored in the Java.swing package and those related to input/output functionality are stored in Java.io
  • Book cover image for: Java Programming for Spatial Sciences
    • Jo Wood(Author)
    • 2002(Publication Date)
    • CRC Press
      (Publisher)
    There are many object-oriented languages available, but a trend in the last decade or so has been for these languages to become increasingly complicated. They are often rather intimidating for the novice programmer. One of the design principles behind the development of Java was to try and simplify object-oriented modelling as much as possible. In comparison with C++, a similar object-oriented language, Java tends to be easier to use, especially for the beginning programmer.
    Being a recently developed language, Java incorporates some of the more modern and useful developments in programming technologies. For example, Java is one of the few languages that has been designed at the outset to incorporate world-wide web technologies. Many of the early applications of Java involved creating appletsJava programs that could be placed on web pages and used by others over the internet. This association with the web has meant that recent web-friendly technologies such as the Extensible Markup Language (XML) and XML stylesheet language transformations (XSLT) have been rapidly integrated with Java.
    Java is unusual as a compiled programming language in that it is platform independent. That is (in theory at least), you can write working programs in Java on a Windows computer, and someone else can modify and run the same program on a Unix or Apple Mac machine. The so-called ‘write once, run anywhere’ principle has certainly proved attractive to application developers who wish to cut down on their development time on multiple platforms. This principle is particularly attractive to those producing internet-friendly programs, where it is not always possible to predict what computer a potential client might be using when running your code.
    Java and JavaScript
    There is sometimes confusion between Java and the completely separate language JavaScript
  • Book cover image for: Hardware Description Languages
    ________________________ WORLD TECHNOLOGIES ________________________ Chapter 12 Java (Programming Language) 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 compiled to 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, and is widely used from application software to web applications. The original and reference implementation Java compilers, virtual machines, and class libraries were developed by Sun from 1995. As of May 2007, in compliance with the specifications of the Java 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. ________________________ WORLD TECHNOLOGIES ________________________ History Duke, the Java mascot James Gosling, Mike Sheridan, and Patrick Naughton initiated the Java language project in June 1991. Java was originally designed for interactive television, but it was too advanced for the digital cable television industry at the time. The language was initially called Oak after an oak tree that stood outside Gosling's office; it went by the name Green later, and was later renamed Java , from a list of random words.
  • Book cover image for: Java Made Simple
    eBook - PDF
    • P K Mcbride(Author)
    • 2017(Publication Date)
    • Routledge
      (Publisher)
    1 Introducing Java 1 c I I' What is Java? ................... 2 Programming languages ........... 4 The Java Virtual Machine .......... 6 Object oriented programming ....... 8 Objects and classes .............. 10 The Java SDK .................. 12 Getting ready .................. 16 The first application ............. 18 The first appfet ................ 21 Viewing appleh ................ 24 Exercises ...• ................. 26 What is lava? Java is a platform-independent, object oriented, multi-threading, dynamically-linked programming language-and it has a lot of jargon. I'll try to keep the jargon to a minimum, but some is unavoidable. With that it mind, I'll try to answer the 'What is Java?' question again. Java is a programming language developed by Sun Microsystems, primarily for use on the World Wide Web. It has a lot in common with C++, so if you are competent in that language, you are well on the way to understanding Java. This book does not assume that you know anything about C++, or any other programming language, though a familiarity with Windows and a Web browser is assumed. What can you do with Java? 2 With Java, you can produce three distinct types of programs -applets, applications and beans. Applets are programs embedded into the HTML documents that form Web pages. Typically, they are small-so that someone browsing the Web does not have to wait long to download them. They will normally serve a limited purpose. Applets may provide a slicker means of navigating round a Web site, produce attention-grabbing animations, or simply entertain to encourage visitors to return regularly. They can also be used for more serious work. Plain Web pages are good for display but allow only limited feedback. Applets add true on-line interaction with the visitor -an insurance business, for example, could use applets to calculate instant quotes.
  • Book cover image for: Developing Java Software
    • Russel Winder, Graham Roberts(Authors)
    • 2014(Publication Date)
    • Wiley
      (Publisher)
    • You can get it for free! Very important this, as it allows potential users to try out a new language with very little start-up cost (at least, in direct financial terms). Interestingly, this list shows that the most important thing about a new language is the social aspect—people must want to use it because it does something they want to do now. Technical considerations often come a distant second! Overall, Java was launched in the right place (on the Web), at the right time (just as the Web was getting really popular), with the right features (it is dynamic and object-oriented) and at the right cost (free). The name Java is typically used as a generic label encompassing the Java programming language, the tools and environment of the development kit and all the class libraries and APIs that are delivered as standard. To a large extent all these elements are inseparable, so learning 1.3 Being at the Right Place at the Right Time 1.4 What is Java? 1.5 Abstraction: The Critical Core of Programming 7 about Java is learning about them all. Sometimes you hear references to the ‘Java Programming System’ or more usually (and properly) the ‘Java 2 Platform’, emphasizing that Java is not just a programming language on its own. Java provides an object-oriented programming language. The chapters in Part 1 of this book will describe what this means. For now we need only know that a programming language allows you to express programs in a textual form, and that object-oriented development is the modern approach to designing and building systems, which is best supported by programming languages that embody directly the key object-oriented concepts. Object-oriented development is now widely used as it addresses a large number of the problems that arise during software development, providing viable and practical solutions. This is of enormous significance as the track record for successful software development is perceived to be very poor.
  • Book cover image for: Java Foundations
    • Todd Greanier(Author)
    • 2006(Publication Date)
    • Sybex
      (Publisher)
    Java has commonality with each of these as well as many differences. In this section, you’ll see how Java stacks up head to head with these languages and why Java might be a better choice. We can group programming languages into three categories. First are the compiled languages such as C and C++ that are bound to each native platform, making them high performance but not very portable. Second are the scripting languages such as JavaScript and Python that are useful for portable processing but have little to offer in the way of performance. Third, and somewhere in between these first two categories, is the Java language itself. It combines the portability and simplicity of the scripting languages, yet it can execute at speeds comparable to the compiled languages. Because of this unique combination of traits, Java can solve many problems in many different situations. C++ An object-oriented version of the C pro-gramming language that gained immense popularity in the early 1990s. C++ can be thought of as a close cousin to the Java programming language. Java and C++ C++ is another popular, object-oriented language that can be used to create high-performance code. In fact, most enterprise develop-ment that is not being written in Java is probably being written in C++. As a language, C++ is syntactically fairly simple, though it is not as user friendly as Java tends to be. C++ is also truly compiled code, so it cannot run on just any platform without a binary executable for the system. Although both languages are classified as object oriented, Java was designed with those concepts in mind from the beginning. This contributes to Java’s flexibility, syntactic simplicity, and overall “friendliness.” The History of Java 11 JavaScript A scripting language developed by Netscape to add interactivity to web doc-uments.
  • Book cover image for: Java Programming
    eBook - PDF
    In this book, you will learn about how to do both. Copyright 2019 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s). Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it. 10 Creating Java Programs C H A P T E R 1 Features of the Java Programming Language Java was developed by Sun Microsystems as an object-oriented language for general-purpose business applications and for interactive, World Wide Web-based Internet applications. (Sun was later acquired by Oracle Corporation.) Some of the advantages that make Java a popular language are its security features and the fact that it is architecturally neutral. That means that, unlike many other languages, you can use Java to write a program that runs on any operating system (such as Windows, Mac OS, or Linux) or device (such as PCs, phones, and tablet computers). Java can be run on a wide variety of computers and devices because it does not execute instructions on a computer directly. Instead, Java runs on a hypothetical computer known as the Java Virtual Machine (JVM). When programmers call the JVM hypothetical, they mean it is not a physical entity created from hardware, but is composed only of software. Figure 1-3 shows the Java environment. Programming statements written in a high-level programming language are source code. When you write a Java program, you first construct the source code using a plain text editor such as Notepad, or you can use a development environment such as Eclipse, NetBeans, or jGRASP. A development environment is a set of tools that help you write programs by providing such features as displaying a language’s keywords in color.
  • Book cover image for: How to Program Using Java
    • Tony Jenkins, Graham Hardman(Authors)
    • 2017(Publication Date)
    • Red Globe Press
      (Publisher)
    Stroustrup was influenced by Simula and wanted to extend C to include object-oriented facilities. C offers significant advantages over C for many applications, although even Stroustrup himself has remarked that C is still to be preferred in some areas. The key is choice; C can be used as an object-oriented language or it can be used in a more traditional, C-like, way. This flexibility means that C became one of the most popular programming languages in a whole range of applications. Java can in a way be seen as a further development of C , although it was developed from a “clean slate”. The history of C and its development means that it is effectively a hybrid language; in some ways it is an object-oriented language while in others it is more traditional. Java is a much more pure object-oriented language. Java was developed by a group led by James Gosling at Sun Microsystems. It started out as part of something called the “Green Project”, a research and development project started by Sun to try to look ahead to future trends in computing. The project developed various electronic gadgets aimed at the consumer market. These gadgets needed to be programmed and so a new language, originally called Oak, was developed. Oak is the language that eventually became Java; rumour has is it that the name was changed when the Green Project discovered that there was already a programming language called Oak. The name “Java” has a lot to do with coffee, a very popular drink among computer programmers; the Java logo of a steaming coffee cup can be see on Sun’s Java web pages to this day (and versions of it are liberally spread around this book!). Java is now one of the most popular programming languages around. Its heritage and design means that programs written in Java can run unaltered on all sorts of computers and devices (I have a mobile phone that can run small Java programs!).
  • Book cover image for: Java Programming Fundamentals
    eBook - PDF

    Java Programming Fundamentals

    Problem Solving Through Object Oriented Analysis and Design

    • Premchand S. Nair(Author)
    • 2008(Publication Date)
    • CRC Press
      (Publisher)
    1 C H A P T E R 1 Object Model of Computation In this chapter you learn Object-oriented concepts Object model of computation and use case analysis Java concepts Compiler, interpreter, virtual machine, bytecode, Unicode character set, and file naming conventions INTRODUCTION Human history is punctuated by inventions of various useful machines. Machines either make our day-to-day life more comfortable or enable us to perform some new tasks. Inven-tion of the air conditioner has greatly improved our comfort level during the hot sum-mer months, and the invention of the television added a whole new dimension to our experience. Along came computer, another human-made machine. Computers revolutionized the world well beyond human imagination. Computers are becoming smarter and smaller day-by-day. A computer can be used to perform many different tasks: 1. To write a poem using your favorite word processor 2. To send an instant message to your friends 3. To show your creativity on a web page 4. To listen to the music You may be well aware of the fact that each of the above tasks is accomplished with the help of different software . Software is created using programming languages . Java is one of the latest programming languages. Since Java is a recently developed language, its design is guided by wisdom, insights, and experience gained over past half a century of soft ware • • • • 2 ■ Java Programming Fundamentals development. In particular, Java is designed as a programming language that naturally promotes object-oriented software development. This text teaches you Java programming in an object-oriented way. Self-Check 1. Name a popular software for word processing. 2. Name a programming language other than Java. OBJECT MODEL OF COMPUTATION Object-oriented analysis and design is the latest paradigm for soft ware development. Therefore, it is imperative that you have a good understanding of some of the fundamental concepts involved.
  • Book cover image for: Programming for Linguists
    eBook - PDF

    Programming for Linguists

    Java Technology for Language Researchers

    Moreover, the software may not be intuitive, and may require learning some arcane set of commands or some difficult control language. Finally, while software may exist to do what you want, it may be unavailable on the platform you work on (Windows, Mac, or Unix), or it may be too costly. 1.2 Why Java Technology? The Java programming language may provide an answer. First, it is a com-plete programming language, with all the bells and whistles. It can do all the file manipulation and text searching one might want, while at the same time, it has all the graphical capabilities of a language like C . Moreover, it’s free . There are free Java implementations for every type of computer. In addition, code written and compiled on one type of machine will run on any other type. In other words, you can write your code at home on your Mac, and run it at work on your Windows machine, or send it to a colleague to run under Unix. This also suggests that Java programs you write should continue to be usable for many years, since the language is so widely used. Finally, one of the most compelling features of Java programs is the fact that they can be run over the web in your web browser. What this means is that you can write a program, put it on the web, and allow others to run your program on their own machines simply by going to your web page. The only downside is that since the Java language can do so much, it can be quite complex. There are lots and lots of features that enable Java programs to do pretty much anything you want. For the novice programmer, this can be intimidating. We won’t let this deter us though. My strategy will be to pick and choose. I’ll introduce those bits of Java technology that are necessary to do the kinds of things people who work with language typically want to do. The rest – all the bells and whistles that we don’t need on our train – we’ll leave for later.
Index pages curate the most relevant extracts from our library of academic textbooks. They’ve been created using an in-house natural language model (NLM), each adding context and meaning to key research topics.