Java is a general-purpose programming language that is both compiled and interpreted. It allows developers to "write once, run anywhere," meaning that Java code can run on any device that supports a Java Virtual Machine (JVM), without needing to be recompiled. The key features of Java include being simple, object-oriented, robust, secure, portable, and high-performance. Java code is first compiled into bytecode, which can then be executed by a JVM on various operating systems like Windows, Linux, and macOS.
This document provides an introduction and overview of the Java programming language, including its history, features, and components. It discusses how Java was developed in 1995 at Sun Microsystems and introduced as a platform-independent language for general business applications and web-based internet applications. It also summarizes Java's key features like being object-oriented, compiled and interpreted, and portable, as well as its core architecture components like the Java programming language, Java Virtual Machine, and Java API.
This document provides an introduction to programming in Java. It discusses key Java concepts like object-oriented programming, classes, objects, and encapsulation. It explains that Java code is compiled to bytecode that runs on a virtual machine, making Java portable across platforms. The document also gives an overview of Java features and components like the Java Development Kit tools, APIs, and libraries. It provides examples of simple Java programs and how they are compiled and executed.
This document provides an introduction to the Java programming language. It discusses that Java was created at Sun Microsystems in 1991 to provide a platform-independent language. Java code is compiled to bytecode that can run on any Java Virtual Machine. The document outlines key Java concepts like object-oriented programming, platform independence, bytecode, the Java Virtual Machine, and garbage collection. It also provides examples of Hello World programs in Java and discusses compiling and running Java code.
- Java was created at Sun Microsystems in 1991 to provide a platform-independent programming language. It is an object-oriented language similar to C++ but simpler and more robust.
- Java code is compiled into bytecode that can run on any Java Virtual Machine (JVM), allowing "write once, run anywhere" capability. The JVM handles running the bytecode.
- Java supports object-oriented programming features like abstraction, encapsulation, inheritance, and polymorphism. It also supports features like being distributed, multithreaded, secure, and using automatic memory management.
this slide contains about basic introduction of java.it will be helpful for a java beginner. it also useful for java lecture course in your versity.programming with java is very essential for every student.this silde may help you to progress your skill & lernt abc about java.
this slide is about java introductory.it will be helpful for you to know abc of jaba.it also be helpful for u in your versity java course.programming with java is very important for every student.java freshers can grabbed it easily
Universal Java allows developers to write code once and run it anywhere, including on servers, desktops, mobiles, and IoT devices. Java code is portable because it compiles to bytecode that runs on the Java Virtual Machine (JVM), which exists for most platforms. Some key aspects that enable portability include:
1. Separating platform-independent business logic from platform-specific UI code
2. Using common language features and libraries for cross-platform code
3. Transpiling Java to other languages like JavaScript for web apps
4. Ahead-of-time compilation to native code for better performance on devices
The document discusses strategies for writing portable Java code and provides examples using shared business
Java was initially developed by Sun Microsystems in 1991 under the name Oak by James Gosling. It was renamed to Java in 1995 due to legal issues. Java is an object-oriented programming language that is platform independent, meaning Java programs can run on any system with a Java virtual machine. Key features of Java include being simple, secure, robust, portable, and having automatic memory management. Java is commonly used to build mobile and web applications.
The document provides information about Java, including:
- Java is an object-oriented programming language that is platform independent and can be used to create applications for web, desktops, mobile devices, and more.
- Java was originally developed in the early 1990s by James Gosling at Sun Microsystems for use in set-top boxes, but became popular for building web applications and is now widely used.
- The Java Development Kit (JDK) includes tools like javac, java, javadoc and others needed to develop, compile, run and document Java programs, as well as class libraries and documentation. The JVM executes compiled Java code.
This document provides an overview of the Java programming language. It discusses that Java was created in 1995 by James Gosling at Sun Microsystems, originally for television devices but was found to be better suited for internet applications. Java remains popular due to its practicality, backwards compatibility, scalability, platform independence through bytecode, and portability. The document also covers Java editions, a simple Java program example, and key concepts like classes, methods, and the main method.
This document provides an introduction to the Java programming language. It discusses the evolution of Java from its origins at Sun Microsystems in the 1990s as a portable language for devices. Key points include Java's use of bytecode and just-in-time compilation for portability across platforms, its object-oriented features inspired by Smalltalk, and its role in enabling dynamic content on the World Wide Web. The document also outlines Java's core concepts like the Java Virtual Machine, class files, and garbage collection that allow programs to run on any system with a JVM.
The document provides an overview of the Java programming language, including its history, core concepts, and execution process. Some key points:
- Java was created in 1991 by James Gosling at Sun Microsystems with an initial focus on embedded systems, but later expanded to web applications due to the rise of the Internet.
- The Java platform consists of the Java programming language, Java Virtual Machine (JVM), and Java Application Programming Interfaces (APIs). The JVM allows Java programs to run on any hardware/software platform.
- A Java program is compiled into bytecode that can be executed by any JVM, providing platform independence. The execution involves compiling the source code and then interpreting the bytecode on
Java is a programming language and platform that is commonly used to develop desktop applications, web applications, mobile apps, and more. The document introduces Java by explaining what it is, where it is used, the types of Java applications that can be created, and how the Java compilation and execution process works at a high level. It also provides an example "Hello World" Java program to demonstrate the basic anatomy of a Java file, including classes, methods, and how the main method acts as the program entry point.
The document provides an introduction to Java programming including:
- Java is an object-oriented language where programs are written as classes and allows "write once, run anywhere" functionality.
- Key features of Java include being simple, robust, secure, multi-threaded, and dynamically flexible.
- The Java architecture includes the compiler, JVM, JRE and JDK which work together to compile and execute Java code.
- Common Java applications include mobile apps, desktop apps, web apps, games, cloud apps, and IoT apps.
- A basic Java program structure includes documentation, packages, imports, classes, and a main method.
This document provides an overview of object-oriented programming concepts in Java including abstraction, encapsulation, inheritance, and polymorphism. It discusses key Java concepts like classes, objects, methods, and access specifiers. It also covers Java fundamentals like variables, data types, operators, control flow statements, comments, and arrays. Additionally, it describes the Java runtime environment, how to set up a Java development environment, compile and run a simple Java program. The document is intended as an introduction to object-oriented programming and the Java programming language.
Java Evolution
Java was originally developed by Sun Microsystems in 1991 under the name Oak as a language for programming consumer electronics. It was later renamed to Java and became best known as a language for developing applications and applets to run on web browsers over the Internet. Key features of Java include being platform-independent, object-oriented, robust, secure, and having a rich class library. Java applications are compiled to bytecode that runs on a Java Virtual Machine, allowing them to run on any platform that supports Java.
Java Evolution
Java was originally developed by Sun Microsystems in 1991 under the name Oak as a language for programming consumer electronics. It was later renamed to Java and became widely used for internet programming due to its ability to write applications that can run on any platform. Key features of Java include being object-oriented, platform independent, secure, robust, and having a rich class library. Java applications can be standalone programs or applets embedded in web pages. The Java compiler generates bytecode that is executed by a Java Virtual Machine, allowing Java programs to run on any system with a JVM.
The document discusses the fundamentals of object-oriented programming and Java. It covers key concepts like abstraction, encapsulation, inheritance and polymorphism. It also describes the basic structure of a Java program, including classes, objects, methods and variables. It explains how to set up a Java development environment, compile and run a simple Java program.
The document provides an overview of advance Java topics including collections, multithreading, networking, AWT, Swing, JDBC, JSP, and applets. It discusses key aspects of each topic such as the collection framework providing interfaces and classes for storing and manipulating groups of data, multithreading allowing programs to perform multiple tasks simultaneously, and JDBC enabling connection between Java applications and databases. Code examples are also included to demonstrate concepts like a basic Swing program and a simple applet.
The document provides an overview of object oriented programming with Java. It discusses the differences between C++ and Java, the fundamentals of Java programming, and tools available for Java development. Key points include:
- Java is best suited for internet applications while C++ is better for large software.
- Java supports interfaces, packages, and other features not in C++.
- The Java Development Kit (JDK) contains compilers and other tools for creating Java programs.
- Java applications are standalone programs while applets are embedded in web pages.
Book industry standards are evolving rapidly. In the first part of this session, we’ll share an overview of key developments from 2024 and the early months of 2025. Then, BookNet’s resident standards expert, Tom Richardson, and CEO, Lauren Stewart, have a forward-looking conversation about what’s next.
Link to recording, presentation slides, and accompanying resource: https://bnctechforum.ca/sessions/standardsgoals-for-2025-standards-certification-roundup/
Presented by BookNet Canada on May 6, 2025 with support from the Department of Canadian Heritage.
AI and Data Privacy in 2025: Global TrendsInData Labs
In this infographic, we explore how businesses can implement effective governance frameworks to address AI data privacy. Understanding it is crucial for developing effective strategies that ensure compliance, safeguard customer trust, and leverage AI responsibly. Equip yourself with insights that can drive informed decision-making and position your organization for success in the future of data privacy.
This infographic contains:
-AI and data privacy: Key findings
-Statistics on AI data privacy in the today’s world
-Tips on how to overcome data privacy challenges
-Benefits of AI data security investments.
Keep up-to-date on how AI is reshaping privacy standards and what this entails for both individuals and organizations.
Ad
More Related Content
Similar to this_is_how_to_start_coding_in_java_lang.ppt (20)
this slide contains about basic introduction of java.it will be helpful for a java beginner. it also useful for java lecture course in your versity.programming with java is very essential for every student.this silde may help you to progress your skill & lernt abc about java.
this slide is about java introductory.it will be helpful for you to know abc of jaba.it also be helpful for u in your versity java course.programming with java is very important for every student.java freshers can grabbed it easily
Universal Java allows developers to write code once and run it anywhere, including on servers, desktops, mobiles, and IoT devices. Java code is portable because it compiles to bytecode that runs on the Java Virtual Machine (JVM), which exists for most platforms. Some key aspects that enable portability include:
1. Separating platform-independent business logic from platform-specific UI code
2. Using common language features and libraries for cross-platform code
3. Transpiling Java to other languages like JavaScript for web apps
4. Ahead-of-time compilation to native code for better performance on devices
The document discusses strategies for writing portable Java code and provides examples using shared business
Java was initially developed by Sun Microsystems in 1991 under the name Oak by James Gosling. It was renamed to Java in 1995 due to legal issues. Java is an object-oriented programming language that is platform independent, meaning Java programs can run on any system with a Java virtual machine. Key features of Java include being simple, secure, robust, portable, and having automatic memory management. Java is commonly used to build mobile and web applications.
The document provides information about Java, including:
- Java is an object-oriented programming language that is platform independent and can be used to create applications for web, desktops, mobile devices, and more.
- Java was originally developed in the early 1990s by James Gosling at Sun Microsystems for use in set-top boxes, but became popular for building web applications and is now widely used.
- The Java Development Kit (JDK) includes tools like javac, java, javadoc and others needed to develop, compile, run and document Java programs, as well as class libraries and documentation. The JVM executes compiled Java code.
This document provides an overview of the Java programming language. It discusses that Java was created in 1995 by James Gosling at Sun Microsystems, originally for television devices but was found to be better suited for internet applications. Java remains popular due to its practicality, backwards compatibility, scalability, platform independence through bytecode, and portability. The document also covers Java editions, a simple Java program example, and key concepts like classes, methods, and the main method.
This document provides an introduction to the Java programming language. It discusses the evolution of Java from its origins at Sun Microsystems in the 1990s as a portable language for devices. Key points include Java's use of bytecode and just-in-time compilation for portability across platforms, its object-oriented features inspired by Smalltalk, and its role in enabling dynamic content on the World Wide Web. The document also outlines Java's core concepts like the Java Virtual Machine, class files, and garbage collection that allow programs to run on any system with a JVM.
The document provides an overview of the Java programming language, including its history, core concepts, and execution process. Some key points:
- Java was created in 1991 by James Gosling at Sun Microsystems with an initial focus on embedded systems, but later expanded to web applications due to the rise of the Internet.
- The Java platform consists of the Java programming language, Java Virtual Machine (JVM), and Java Application Programming Interfaces (APIs). The JVM allows Java programs to run on any hardware/software platform.
- A Java program is compiled into bytecode that can be executed by any JVM, providing platform independence. The execution involves compiling the source code and then interpreting the bytecode on
Java is a programming language and platform that is commonly used to develop desktop applications, web applications, mobile apps, and more. The document introduces Java by explaining what it is, where it is used, the types of Java applications that can be created, and how the Java compilation and execution process works at a high level. It also provides an example "Hello World" Java program to demonstrate the basic anatomy of a Java file, including classes, methods, and how the main method acts as the program entry point.
The document provides an introduction to Java programming including:
- Java is an object-oriented language where programs are written as classes and allows "write once, run anywhere" functionality.
- Key features of Java include being simple, robust, secure, multi-threaded, and dynamically flexible.
- The Java architecture includes the compiler, JVM, JRE and JDK which work together to compile and execute Java code.
- Common Java applications include mobile apps, desktop apps, web apps, games, cloud apps, and IoT apps.
- A basic Java program structure includes documentation, packages, imports, classes, and a main method.
This document provides an overview of object-oriented programming concepts in Java including abstraction, encapsulation, inheritance, and polymorphism. It discusses key Java concepts like classes, objects, methods, and access specifiers. It also covers Java fundamentals like variables, data types, operators, control flow statements, comments, and arrays. Additionally, it describes the Java runtime environment, how to set up a Java development environment, compile and run a simple Java program. The document is intended as an introduction to object-oriented programming and the Java programming language.
Java Evolution
Java was originally developed by Sun Microsystems in 1991 under the name Oak as a language for programming consumer electronics. It was later renamed to Java and became best known as a language for developing applications and applets to run on web browsers over the Internet. Key features of Java include being platform-independent, object-oriented, robust, secure, and having a rich class library. Java applications are compiled to bytecode that runs on a Java Virtual Machine, allowing them to run on any platform that supports Java.
Java Evolution
Java was originally developed by Sun Microsystems in 1991 under the name Oak as a language for programming consumer electronics. It was later renamed to Java and became widely used for internet programming due to its ability to write applications that can run on any platform. Key features of Java include being object-oriented, platform independent, secure, robust, and having a rich class library. Java applications can be standalone programs or applets embedded in web pages. The Java compiler generates bytecode that is executed by a Java Virtual Machine, allowing Java programs to run on any system with a JVM.
The document discusses the fundamentals of object-oriented programming and Java. It covers key concepts like abstraction, encapsulation, inheritance and polymorphism. It also describes the basic structure of a Java program, including classes, objects, methods and variables. It explains how to set up a Java development environment, compile and run a simple Java program.
The document provides an overview of advance Java topics including collections, multithreading, networking, AWT, Swing, JDBC, JSP, and applets. It discusses key aspects of each topic such as the collection framework providing interfaces and classes for storing and manipulating groups of data, multithreading allowing programs to perform multiple tasks simultaneously, and JDBC enabling connection between Java applications and databases. Code examples are also included to demonstrate concepts like a basic Swing program and a simple applet.
The document provides an overview of object oriented programming with Java. It discusses the differences between C++ and Java, the fundamentals of Java programming, and tools available for Java development. Key points include:
- Java is best suited for internet applications while C++ is better for large software.
- Java supports interfaces, packages, and other features not in C++.
- The Java Development Kit (JDK) contains compilers and other tools for creating Java programs.
- Java applications are standalone programs while applets are embedded in web pages.
Book industry standards are evolving rapidly. In the first part of this session, we’ll share an overview of key developments from 2024 and the early months of 2025. Then, BookNet’s resident standards expert, Tom Richardson, and CEO, Lauren Stewart, have a forward-looking conversation about what’s next.
Link to recording, presentation slides, and accompanying resource: https://bnctechforum.ca/sessions/standardsgoals-for-2025-standards-certification-roundup/
Presented by BookNet Canada on May 6, 2025 with support from the Department of Canadian Heritage.
AI and Data Privacy in 2025: Global TrendsInData Labs
In this infographic, we explore how businesses can implement effective governance frameworks to address AI data privacy. Understanding it is crucial for developing effective strategies that ensure compliance, safeguard customer trust, and leverage AI responsibly. Equip yourself with insights that can drive informed decision-making and position your organization for success in the future of data privacy.
This infographic contains:
-AI and data privacy: Key findings
-Statistics on AI data privacy in the today’s world
-Tips on how to overcome data privacy challenges
-Benefits of AI data security investments.
Keep up-to-date on how AI is reshaping privacy standards and what this entails for both individuals and organizations.
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...Noah Loul
Artificial intelligence is changing how businesses operate. Companies are using AI agents to automate tasks, reduce time spent on repetitive work, and focus more on high-value activities. Noah Loul, an AI strategist and entrepreneur, has helped dozens of companies streamline their operations using smart automation. He believes AI agents aren't just tools—they're workers that take on repeatable tasks so your human team can focus on what matters. If you want to reduce time waste and increase output, AI agents are the next move.
This is the keynote of the Into the Box conference, highlighting the release of the BoxLang JVM language, its key enhancements, and its vision for the future.
TrsLabs - Fintech Product & Business ConsultingTrs Labs
Hybrid Growth Mandate Model with TrsLabs
Strategic Investments, Inorganic Growth, Business Model Pivoting are critical activities that business don't do/change everyday. In cases like this, it may benefit your business to choose a temporary external consultant.
An unbiased plan driven by clearcut deliverables, market dynamics and without the influence of your internal office equations empower business leaders to make right choices.
Getting things done within a budget within a timeframe is key to Growing Business - No matter whether you are a start-up or a big company
Talk to us & Unlock the competitive advantage
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungenpanagenda
Webinar Recording: https://www.panagenda.com/webinars/hcl-nomad-web-best-practices-und-verwaltung-von-multiuser-umgebungen/
HCL Nomad Web wird als die nächste Generation des HCL Notes-Clients gefeiert und bietet zahlreiche Vorteile, wie die Beseitigung des Bedarfs an Paketierung, Verteilung und Installation. Nomad Web-Client-Updates werden “automatisch” im Hintergrund installiert, was den administrativen Aufwand im Vergleich zu traditionellen HCL Notes-Clients erheblich reduziert. Allerdings stellt die Fehlerbehebung in Nomad Web im Vergleich zum Notes-Client einzigartige Herausforderungen dar.
Begleiten Sie Christoph und Marc, während sie demonstrieren, wie der Fehlerbehebungsprozess in HCL Nomad Web vereinfacht werden kann, um eine reibungslose und effiziente Benutzererfahrung zu gewährleisten.
In diesem Webinar werden wir effektive Strategien zur Diagnose und Lösung häufiger Probleme in HCL Nomad Web untersuchen, einschließlich
- Zugriff auf die Konsole
- Auffinden und Interpretieren von Protokolldateien
- Zugriff auf den Datenordner im Cache des Browsers (unter Verwendung von OPFS)
- Verständnis der Unterschiede zwischen Einzel- und Mehrbenutzerszenarien
- Nutzung der Client Clocking-Funktion
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdfAbi john
Analyze the growth of meme coins from mere online jokes to potential assets in the digital economy. Explore the community, culture, and utility as they elevate themselves to a new era in cryptocurrency.
HCL Nomad Web – Best Practices and Managing Multiuser Environmentspanagenda
Webinar Recording: https://www.panagenda.com/webinars/hcl-nomad-web-best-practices-and-managing-multiuser-environments/
HCL Nomad Web is heralded as the next generation of the HCL Notes client, offering numerous advantages such as eliminating the need for packaging, distribution, and installation. Nomad Web client upgrades will be installed “automatically” in the background. This significantly reduces the administrative footprint compared to traditional HCL Notes clients. However, troubleshooting issues in Nomad Web present unique challenges compared to the Notes client.
Join Christoph and Marc as they demonstrate how to simplify the troubleshooting process in HCL Nomad Web, ensuring a smoother and more efficient user experience.
In this webinar, we will explore effective strategies for diagnosing and resolving common problems in HCL Nomad Web, including
- Accessing the console
- Locating and interpreting log files
- Accessing the data folder within the browser’s cache (using OPFS)
- Understand the difference between single- and multi-user scenarios
- Utilizing Client Clocking
How Can I use the AI Hype in my Business Context?Daniel Lehner
𝙄𝙨 𝘼𝙄 𝙟𝙪𝙨𝙩 𝙝𝙮𝙥𝙚? 𝙊𝙧 𝙞𝙨 𝙞𝙩 𝙩𝙝𝙚 𝙜𝙖𝙢𝙚 𝙘𝙝𝙖𝙣𝙜𝙚𝙧 𝙮𝙤𝙪𝙧 𝙗𝙪𝙨𝙞𝙣𝙚𝙨𝙨 𝙣𝙚𝙚𝙙𝙨?
Everyone’s talking about AI but is anyone really using it to create real value?
Most companies want to leverage AI. Few know 𝗵𝗼𝘄.
✅ What exactly should you ask to find real AI opportunities?
✅ Which AI techniques actually fit your business?
✅ Is your data even ready for AI?
If you’re not sure, you’re not alone. This is a condensed version of the slides I presented at a Linkedin webinar for Tecnovy on 28.04.2025.
Procurement Insights Cost To Value Guide.pptxJon Hansen
Procurement Insights integrated Historic Procurement Industry Archives, serves as a powerful complement — not a competitor — to other procurement industry firms. It fills critical gaps in depth, agility, and contextual insight that most traditional analyst and association models overlook.
Learn more about this value- driven proprietary service offering here.
Complete Guide to Advanced Logistics Management Software in Riyadh.pdfSoftware Company
Explore the benefits and features of advanced logistics management software for businesses in Riyadh. This guide delves into the latest technologies, from real-time tracking and route optimization to warehouse management and inventory control, helping businesses streamline their logistics operations and reduce costs. Learn how implementing the right software solution can enhance efficiency, improve customer satisfaction, and provide a competitive edge in the growing logistics sector of Riyadh.
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...Impelsys Inc.
Impelsys provided a robust testing solution, leveraging a risk-based and requirement-mapped approach to validate ICU Connect and CritiXpert. A well-defined test suite was developed to assess data communication, clinical data collection, transformation, and visualization across integrated devices.
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptxJustin Reock
Building 10x Organizations with Modern Productivity Metrics
10x developers may be a myth, but 10x organizations are very real, as proven by the influential study performed in the 1980s, ‘The Coding War Games.’
Right now, here in early 2025, we seem to be experiencing YAPP (Yet Another Productivity Philosophy), and that philosophy is converging on developer experience. It seems that with every new method we invent for the delivery of products, whether physical or virtual, we reinvent productivity philosophies to go alongside them.
But which of these approaches actually work? DORA? SPACE? DevEx? What should we invest in and create urgency behind today, so that we don’t find ourselves having the same discussion again in a decade?
Mobile App Development Company in Saudi ArabiaSteve Jonas
EmizenTech is a globally recognized software development company, proudly serving businesses since 2013. With over 11+ years of industry experience and a team of 200+ skilled professionals, we have successfully delivered 1200+ projects across various sectors. As a leading Mobile App Development Company In Saudi Arabia we offer end-to-end solutions for iOS, Android, and cross-platform applications. Our apps are known for their user-friendly interfaces, scalability, high performance, and strong security features. We tailor each mobile application to meet the unique needs of different industries, ensuring a seamless user experience. EmizenTech is committed to turning your vision into a powerful digital product that drives growth, innovation, and long-term success in the competitive mobile landscape of Saudi Arabia.
2. What is Java?
• A programming language
– Fully buzzword-compliant:
A simple, object oriented, distributed, interpreted,
robust, secure, architecture neutral, portable, high
performance, multithreaded, dynamic language.
From: Java: An Overview
James Gosling, Sun Microsystems,
February 1995.
3. What Else is Java?
• According to Gosling:
– “An environment”
– “A platform”
– “A way of thinking”
– …ok, whatever
• Java is a phenomenon
– Took the world by storm in 1995 when
introduced with the HotJava web Browser
– Quickly integrated with Netscape browser
4. Some History
• 1993 Oak project at Sun
– small, robust, architecture independent, Object-Oriented, language to
control interactive TV.
– didn’t go anywhere
• 1995 Oak becomes Java
– Focus on the web
• 1996 Java 1.0 available
• 1997 (March) Java 1.1 - some language changes, much larger library, new
event handling model
• 1997 (September) Java 1.2 beta – huge increase in libraries including Swing,
new collection classes, J2EE
• 1998 (October) Java 1.2 final (Java2!)
• 2000 (April) Java 1.3 final
• 2001 Java 1.4 final (assert)
• 2004 Java 1.5 (parameterized types, enum, …) (Java5!)
• 2005 J2EE 1.5
5. What is Java?
• Java is a general-purpose, high-level
programming language.
– The features of Java
• Java program is both compiled and interpreted.
• Write once, run anywhere
• Java is a software-only platform running on
top of other, hardware-based platforms.
– Java Virtual Machine (Java VM)
– The Java Application Programming Interface
(JAVA API)
7. How Will Java Change My Life?
• Get started quickly
• Write less code
• Write better code
• Develop programs faster
• Avoid platform dependencies with 100%
pure Java
• Write once, run anywhere
• Distribute software more easily
8. Java Applications and Java … lets
• Stand-alone Applications
– Just like any programming language
• Applet
– Run under a Java-Enabled Browser
• Midlet
– Run in a Java-Enabled Mobile Phone
• Servlet
– Run on a Java-Enabled Web Server
• Switchlet
– …
13. ByteCode: Food for the VM
• For most languages, compilation
produces machine code
• Java compilation produces “bytecode”
– Intermediate code readable by the VM
– Transferable across the Internet as applets
• VM interprets BC into instructions
– Partly responsible for performance lag
• ByteCode produced on any platform
may be executed on any other platform
which supports a VM
14. virtual machine
execution model of Java
source
(text) compiler
CPU
bytecode
interpreter
dynamic
loading
JIT
compiler
compiled
code
JVML
verifier
bytecode
(aka. class file)
15. The JIT
• Just-In-Time compiler
• Translates bytecode into machine code
at runtime
– 1-time overhead when run initiated
– Performance increase 10-30 times
• Now the default for most JVM’s
– Can be turned off if desired
– JIT can apply statistical optimizations
based on runtime usage profile
16. Not just one JVM, but a whole
family
• JVM (J2EE & J2SE)
– Well-known Java Virtual Machine.
• CVM, KVM (J2ME)
– Small devices.
– Reduces some VM features to fit resource-constrained
devices.
• JCVM (Java Card)
– Smart cards.
– It has least VM features.
• And there are also lots of other JVMs
18. Java VM and API
• Java API and Virtual
Machine insulate the
Java program from
hardware
dependencies.
• Java API
19. Java API
• Collection of ready-
made software
components that
provide many useful
capabilities.
• Grouped into libraries
(packages) of related
components.
• Core API
– Essentials: Object,
String, Input and
Output...
– Applets
– Networking
– Internationalization
– Security
– Software Components
– Object Serialization
– Java Database
Connectivity (JDBC)
21. Create a Java Source File
public class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello World!");
}
}
22. Compile and Run
• Compile
– javac HelloWorld.java
• One file named HelloWorld.class is
created if the compilation is succeeds.
• Run
– java HelloWorld
23. The Simplest Java Application:
Hello,World!
• Since Java is object-oriented, programs are organized into modules
called classes, which may have data in variables and subroutines
called methods.
class HelloWorld
{ public static void main (String[] args)
{ System.out.println(“Hello World!”);
}
}
Each program is enclosed in a class definition.
Each program is enclosed in a class definition.
main() is the first method that is run.
main() is the first method that is run.
The notation class.method or
The notation class.method or
package.class.method is how to
package.class.method is how to
refer to a public method (with
refer to a public method (with
some exceptions).
some exceptions).
Syntax is similar to C - braces for
Syntax is similar to C - braces for
blocks, semicolon after each
blocks, semicolon after each
statement. One difference: upper
statement. One difference: upper
and lower case matter!
and lower case matter!
25. Create a Java Source File
HelloWorldApplet.java
• import java.applet.Applet;
import java.awt.Graphics;
public class HelloWorldApplet extends Applet
{
public void paint(Graphics g) {
g.drawString(“Hello World!”, 5, 25);
}
}
26. Compile the Source File
• javac HelloWorldApplet.java
• One file named HelloWorldApplet.class is
created if the compilation is succeeds.
27. Displaying your applet from a Web page.
• Create an HTML file with an applet tag to display the results of
drawing the applet.
<html><head>
<title>Simple Hello Page</title>
</head>
<body>
My Java applet says:
<applet code=“HelloWorldApplet.class” width=150 height=25>
</applet>
</body></html>
Name of your applet class.
The browser will use a rectangle of width 150 pixels and
The browser will use a rectangle of width 150 pixels and
height 25 pixels to display the applet within the other html.
height 25 pixels to display the applet within the other html.
28. The Simplest Java Applet: Hello, World!
• Java applets are part of the class hierarchy that can call methods to
display on a screen (within the browser window). One way to draw on
the screen is to call the method drawString from the standard method
paint.
import java.awt.Graphics;
public class HelloWorldApplet extends java.applet.Applet
{ public void paint (Graphics g)
{ g.drawString(“Hello World!”, 5, 25);
}
}
The import statement allows the use of methods
The import statement allows the use of methods
from the Graphics class without the dot notation .
from the Graphics class without the dot notation .
The paint method displays a graphics object on the
The paint method displays a graphics object on the
screen - one of the standard methods that takes the
screen - one of the standard methods that takes the
place of main for applets.
place of main for applets.
Puts this as a subclass of Applet.
Puts this as a subclass of Applet.
29. No main method
• Yes, applets have a main method...
• ...but it's in the browser, not in your code!
• More about that later in the course …