To review computer basics, programs, and operating systems
To explore the relationship between Java and the World Wide Web
To distinguish the terms API, IDE, and JDK
To write a simple Java program
To display output on the console
To explain the basic syntax of a Java program
To create, compile, and run Java programs
(GUI) To display output using the JOptionPane output dialog boxes
JAVA was developed by Sun Microsystems Inc in 1991, later acquired by Oracle Corporation. It was developed by James Gosling and Patrick Naughton. It is a simple programming language. Writing, compiling and debugging a program is easy in java. It helps to create modular programs and reusable code.
Introduction to Java Programming, Basic Structure, variables Data type, input...Mr. Akaash
This is First Lecture of java Programming which cover all basic points (ie. History and feature of java, Introduction to java, about variables data type and compilation....
JAVA was developed by Sun Microsystems Inc in 1991, later acquired by Oracle Corporation. It was developed by James Gosling and Patrick Naughton. It is a simple programming language. Writing, compiling and debugging a program is easy in java. It helps to create modular programs and reusable code.
Introduction to Java Programming, Basic Structure, variables Data type, input...Mr. Akaash
This is First Lecture of java Programming which cover all basic points (ie. History and feature of java, Introduction to java, about variables data type and compilation....
A presentation on core java. in this ppt there are all the basic informations on the core java suvh as-
Features of Java
Java Program Translation
Java Virtual Machine
Java system overview
Java Program-Development phase
Advantage of java
Disadvantage of java
Project
Introduction to Java : Feature to Java, Java Virtual Machine, Differences between C++ and Java,
Part of Java, API Document, Starting a Java Program. Important Classes, Formatting the Output
Create Splash Screen with Java Step by StepOXUS 20
This presentation guide you how to make a custom Splash Screen step by step using Java Programming. In addition, you will learn the concept and usage of Java Timer, Java Progress Bar and Window ...
This presentation guide you how to make a custom Splash Screen step by step using Java Programming. In addition, you will learn the concept and usage of Java Timer, Java Progress Bar and Window ...
A presentation on core java. in this ppt there are all the basic informations on the core java suvh as-
Features of Java
Java Program Translation
Java Virtual Machine
Java system overview
Java Program-Development phase
Advantage of java
Disadvantage of java
Project
Introduction to Java : Feature to Java, Java Virtual Machine, Differences between C++ and Java,
Part of Java, API Document, Starting a Java Program. Important Classes, Formatting the Output
Create Splash Screen with Java Step by StepOXUS 20
This presentation guide you how to make a custom Splash Screen step by step using Java Programming. In addition, you will learn the concept and usage of Java Timer, Java Progress Bar and Window ...
This presentation guide you how to make a custom Splash Screen step by step using Java Programming. In addition, you will learn the concept and usage of Java Timer, Java Progress Bar and Window ...
Object Oriented Programming (OOP) makes it easier for programmers to structure and form software programs; since individual objects can be modified without touching other aspects of the program.
With this presentation we are covering most OOP features (Class, Object, Inheritance, Polymorphism, Encapsulation, etc.) with real life examples.
Regular Expressions (Regex) is powerful and convenient to use for string manipulation i.e. matching and validation, extracting and capturing, modifying and substitution, etc. This presentation covers Regular Expression with real world examples and demos.
PHP Basic and Fundamental Questions and Answers with Detail ExplanationOXUS 20
These PHP basic and fundamental questions and answers with detail explanation help students and learners to think comprehensive, and to seek more to understand the concept and the root of each topic concretely.
Java Virtual Keyboard Using Robot, Toolkit and JToggleButton ClassesOXUS 20
A Virtual Keyboard is considered to be a component to use on computers without a real keyboard e.g. Touch Screen Computers and Smart Phones; where a mouse can utilize the keyboard functionalities and features.
In addition, Virtual Keyboard used for the following subjects: Foreign Character Sets, Touchscreen, Bypass Key Loggers, etc.
With Unicode you can program and accomplish many funny, cool and useful programs and tools as for instance, Abjad Calculator calculating the numerical value of letters derived from the Arabic alphabet through the use of the Abjad writing system, Bubble Text Generator to write letters in circle, Flip Text Generator to write letters upside down, Google Transliteration to convert English names to Persian/Arabic, etc.
This presentation introduces Java Applet and Java Graphics in detail with examples and finally using the concept of both applet and graphics code the analog clock project to depict how to use them in real life challenges and applications.
This presentation explores and discusses the practical and useful of Regular Expressions covering username validation, complex and strong password validation, password strength checker, email validation, and finally image file extension validation.
Fal-e-Hafez (Omens of Hafez) Cards in Persian using JavaOXUS 20
This presentation explains step by step how to develop and code Fal-e Hafez (Omens of Hafez) Cards in Persian Using JAVA. There are several applications which are coded by different programming languages i.e. Java languages for Desktops and Mobiles, HTML and CSS and PHP for Web Pages, etc. and this shows the importance of Omens of Hafez among the Persian people.
Object Oriented Concept Static vs. Non StaticOXUS 20
Static is not the true intend of Object Oriented Design and Concept.
For instance, we turn a LAMP "off" it does not suppose to turn the LAMPS of the entire world goes "off".
This tutorial explains step by step writing a simple guessing game where the player guess the number selected by the computer and the goal is to introduce the power and usage of RANDOM as well as the how to benefit CURRENTTIMEMILLIS method of the System class in order to check how much it took the player guessing the correct number.
Web Design and Development Life Cycle and TechnologiesOXUS 20
This presentation is an introduction to the design, creation, and maintenance of web design and development life cycle and web technologies. With it, you will learn about the web technologies, the life cycle of developing an efficient website and web application and finally some web essentials questions will be provided and reviewed.
Everything about Database JOINS and RelationshipsOXUS 20
Today, we continue our journey into the world of RDBMS (relational database management systems) and SQL (Structured Query Language).
In this presentation, you will understand about some key definitions and then you will learn how to work with multiple tables that have relationships with each other.
First, we will go covering some core concepts and key definitions, and then will begin working with JOINs queries in SQL.
With Unicode you can program and accomplish many funny, cool and useful programs and tools as for instance, Abjad Calculator, Bubble Text Generator to write letters in circle, Flip Text Generator to write letters upside down, Google Transliteration to convert English names to Persian/Arabic, etc...
Java Virtual Keyboard Using Robot, Toolkit and JToggleButton ClassesAbdul Rahman Sherzad
A Virtual Keyboard is considered to be a component to use on computers without a real keyboard e.g. Touch Screen Computers and Smart Phones; where a mouse can utilize the keyboard functionalities and features.
In addition, Virtual Keyboard used for the following subjects: Foreign Character Sets, Touchscreen, Bypass Key Loggers, etc.
intoduction to Computer programming java learn for more chapter contact salma...Syed Shah
intoduction to Computer programming java learn for more chapter contact salmanshah2014@hotmail.com or https://www.flickr.com/photos/130029004@N06/ or salmanshah2018@hotmail.com
Array Basics
Copying Arrays
Passing Arrays to Methods
Returning an Array from a Method
(Optional) Variable-Length Argument Lists
The Arrays Class
Two-Dimensional Arrays
(Optional) Multidimensional Arrays
Fundamentals of Database Systems Questions and AnswersOXUS 20
Fundamentals of Database Systems questions and answers with explanation for fresher's and experienced for interview, competitive examination and entrance test.
Java GUI PART III is the continues of JAVA GUI PART I and II covering and discussing the GUI components with events and events handling as for instance Action Event, Mouse Event, Key Event, etc...
Java GUI PART II is the continues of JAVA GUI PART I covering and discussing the GUI components as well as the different available Layout Managers which is available in JAVA and you can find dedicated example for each Layout Managers …
A Graphical User Interface (GUI) is a user interface based on graphics i.e. icons, pictures, menus, etc. instead of just plain text, it uses a mouse as well as a keyboard as an input device.
GUI applications enable the users (especially naive ones) to interact with a system easily and friendly. This presentation is meant for the individual who has little or no experience in Java GUI programming.
Modern design is crucial in today's digital environment, and this is especially true for SharePoint intranets. The design of these digital hubs is critical to user engagement and productivity enhancement. They are the cornerstone of internal collaboration and interaction within enterprises.
A Comprehensive Look at Generative AI in Retail App Testing.pdfkalichargn70th171
Traditional software testing methods are being challenged in retail, where customer expectations and technological advancements continually shape the landscape. Enter generative AI—a transformative subset of artificial intelligence technologies poised to revolutionize software testing.
Understanding Globus Data Transfers with NetSageGlobus
NetSage is an open privacy-aware network measurement, analysis, and visualization service designed to help end-users visualize and reason about large data transfers. NetSage traditionally has used a combination of passive measurements, including SNMP and flow data, as well as active measurements, mainly perfSONAR, to provide longitudinal network performance data visualization. It has been deployed by dozens of networks world wide, and is supported domestically by the Engagement and Performance Operations Center (EPOC), NSF #2328479. We have recently expanded the NetSage data sources to include logs for Globus data transfers, following the same privacy-preserving approach as for Flow data. Using the logs for the Texas Advanced Computing Center (TACC) as an example, this talk will walk through several different example use cases that NetSage can answer, including: Who is using Globus to share data with my institution, and what kind of performance are they able to achieve? How many transfers has Globus supported for us? Which sites are we sharing the most data with, and how is that changing over time? How is my site using Globus to move data internally, and what kind of performance do we see for those transfers? What percentage of data transfers at my institution used Globus, and how did the overall data transfer performance compare to the Globus users?
Strategies for Successful Data Migration Tools.pptxvarshanayak241
Data migration is a complex but essential task for organizations aiming to modernize their IT infrastructure and leverage new technologies. By understanding common challenges and implementing these strategies, businesses can achieve a successful migration with minimal disruption. Data Migration Tool like Ask On Data play a pivotal role in this journey, offering features that streamline the process, ensure data integrity, and maintain security. With the right approach and tools, organizations can turn the challenge of data migration into an opportunity for growth and innovation.
Into the Box Keynote Day 2: Unveiling amazing updates and announcements for modern CFML developers! Get ready for exciting releases and updates on Ortus tools and products. Stay tuned for cutting-edge innovations designed to boost your productivity.
First Steps with Globus Compute Multi-User EndpointsGlobus
In this presentation we will share our experiences around getting started with the Globus Compute multi-user endpoint. Working with the Pharmacology group at the University of Auckland, we have previously written an application using Globus Compute that can offload computationally expensive steps in the researcher's workflows, which they wish to manage from their familiar Windows environments, onto the NeSI (New Zealand eScience Infrastructure) cluster. Some of the challenges we have encountered were that each researcher had to set up and manage their own single-user globus compute endpoint and that the workloads had varying resource requirements (CPUs, memory and wall time) between different runs. We hope that the multi-user endpoint will help to address these challenges and share an update on our progress here.
Experience our free, in-depth three-part Tendenci Platform Corporate Membership Management workshop series! In Session 1 on May 14th, 2024, we began with an Introduction and Setup, mastering the configuration of your Corporate Membership Module settings to establish membership types, applications, and more. Then, on May 16th, 2024, in Session 2, we focused on binding individual members to a Corporate Membership and Corporate Reps, teaching you how to add individual members and assign Corporate Representatives to manage dues, renewals, and associated members. Finally, on May 28th, 2024, in Session 3, we covered questions and concerns, addressing any queries or issues you may have.
For more Tendenci AMS events, check out www.tendenci.com/events
Enhancing Research Orchestration Capabilities at ORNL.pdfGlobus
Cross-facility research orchestration comes with ever-changing constraints regarding the availability and suitability of various compute and data resources. In short, a flexible data and processing fabric is needed to enable the dynamic redirection of data and compute tasks throughout the lifecycle of an experiment. In this talk, we illustrate how we easily leveraged Globus services to instrument the ACE research testbed at the Oak Ridge Leadership Computing Facility with flexible data and task orchestration capabilities.
Designing for Privacy in Amazon Web ServicesKrzysztofKkol1
Data privacy is one of the most critical issues that businesses face. This presentation shares insights on the principles and best practices for ensuring the resilience and security of your workload.
Drawing on a real-life project from the HR industry, the various challenges will be demonstrated: data protection, self-healing, business continuity, security, and transparency of data processing. This systematized approach allowed to create a secure AWS cloud infrastructure that not only met strict compliance rules but also exceeded the client's expectations.
Check out the webinar slides to learn more about how XfilesPro transforms Salesforce document management by leveraging its world-class applications. For more details, please connect with sales@xfilespro.com
If you want to watch the on-demand webinar, please click here: https://www.xfilespro.com/webinars/salesforce-document-management-2-0-smarter-faster-better/
top nidhi software solution freedownloadvrstrong314
This presentation emphasizes the importance of data security and legal compliance for Nidhi companies in India. It highlights how online Nidhi software solutions, like Vector Nidhi Software, offer advanced features tailored to these needs. Key aspects include encryption, access controls, and audit trails to ensure data security. The software complies with regulatory guidelines from the MCA and RBI and adheres to Nidhi Rules, 2014. With customizable, user-friendly interfaces and real-time features, these Nidhi software solutions enhance efficiency, support growth, and provide exceptional member services. The presentation concludes with contact information for further inquiries.
Code reviews are vital for ensuring good code quality. They serve as one of our last lines of defense against bugs and subpar code reaching production.
Yet, they often turn into annoying tasks riddled with frustration, hostility, unclear feedback and lack of standards. How can we improve this crucial process?
In this session we will cover:
- The Art of Effective Code Reviews
- Streamlining the Review Process
- Elevating Reviews with Automated Tools
By the end of this presentation, you'll have the knowledge on how to organize and improve your code review proces
Accelerate Enterprise Software Engineering with PlatformlessWSO2
Key takeaways:
Challenges of building platforms and the benefits of platformless.
Key principles of platformless, including API-first, cloud-native middleware, platform engineering, and developer experience.
How Choreo enables the platformless experience.
How key concepts like application architecture, domain-driven design, zero trust, and cell-based architecture are inherently a part of Choreo.
Demo of an end-to-end app built and deployed on Choreo.
Advanced Flow Concepts Every Developer Should KnowPeter Caitens
Tim Combridge from Sensible Giraffe and Salesforce Ben presents some important tips that all developers should know when dealing with Flows in Salesforce.
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERRORTier1 app
Even though at surface level ‘java.lang.OutOfMemoryError’ appears as one single error; underlyingly there are 9 types of OutOfMemoryError. Each type of OutOfMemoryError has different causes, diagnosis approaches and solutions. This session equips you with the knowledge, tools, and techniques needed to troubleshoot and conquer OutOfMemoryError in all its forms, ensuring smoother, more efficient Java applications.
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?XfilesPro
Worried about document security while sharing them in Salesforce? Fret no more! Here are the top-notch security standards XfilesPro upholds to ensure strong security for your Salesforce documents while sharing with internal or external people.
To learn more, read the blog: https://www.xfilespro.com/how-does-xfilespro-make-document-sharing-secure-and-seamless-in-salesforce/
Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...Hivelance Technology
Cryptocurrency trading bots are computer programs designed to automate buying, selling, and managing cryptocurrency transactions. These bots utilize advanced algorithms and machine learning techniques to analyze market data, identify trading opportunities, and execute trades on behalf of their users. By automating the decision-making process, crypto trading bots can react to market changes faster than human traders
Hivelance, a leading provider of cryptocurrency trading bot development services, stands out as the premier choice for crypto traders and developers. Hivelance boasts a team of seasoned cryptocurrency experts and software engineers who deeply understand the crypto market and the latest trends in automated trading, Hivelance leverages the latest technologies and tools in the industry, including advanced AI and machine learning algorithms, to create highly efficient and adaptable crypto trading bots
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...Shahin Sheidaei
Games are powerful teaching tools, fostering hands-on engagement and fun. But they require careful consideration to succeed. Join me to explore factors in running and selecting games, ensuring they serve as effective teaching tools. Learn to maintain focus on learning objectives while playing, and how to measure the ROI of gaming in education. Discover strategies for pitching gaming to leadership. This session offers insights, tips, and examples for coaches, team leads, and enterprise leaders seeking to teach from simple to complex concepts.
2. Objectives
» To review computer basics, programs, and operating
systems
» To explore the relationship between Java and the World
Wide Web
» To distinguish the terms API, IDE, and JDK
» To write a simple Java program
» To display output on the console
» To explain the basic syntax of a Java program
» To create, compile, and run Java programs
» (GUI) To display output using the JOptionPane output
dialog boxes
https://www.facebook.com/Oxus20
3. What is a Computer?
A computer consists of a CPU, memory, hard disk, floppy disk,
monitor, printer, and communication devices.
CPU
e.g., Disk, CD,
and Tape
Input
Devices
e.g., Keyboard,
Mouse
e.g., Monitor,
Printer
Communication
Devices
e.g., Modem,
and NIC
Storage
Devices
Memory
Output
Devices
Bus
https://www.facebook.com/Oxus20
4. CPU
The central processing unit (CPU) is the brain of a computer. It
retrieves instructions from memory and executes them. The CPU
speed is measured in megahertz (MHz), with 1 megahertz equaling 1
million pulses per second. The speed of the CPU has been improved
continuously. If you buy a PC now, you can get an Intel Pentium 4
Processor at 3 gigahertz or more (1 gigahertz is 1000 megahertz).
CPU
e.g., Disk, CD,
and Tape
Input
Devices
e.g., Keyboard,
Mouse
e.g., Monitor,
Printer
Communication
Devices
e.g., Modem,
and NIC
Storage
Devices
Memory
Output
Devices
Bus
https://www.facebook.com/Oxus20
5. Memory
Memory is to store data and program instructions for CPU to
execute. A memory unit is an ordered sequence of bytes, each holds
eight bits. A program and its data must be brought to memory before
they can be executed.
CPU
e.g., Disk, CD,
and Tape
Input
Devices
e.g., Keyboard,
Mouse
e.g., Monitor,
Printer
Communication
Devices
e.g., Modem,
and NIC
Storage
Devices
Memory
Output
Devices
Bus
https://www.facebook.com/Oxus20
6. Storage Devices
Memory is volatile, because information is lost when the power is
off. Programs and data are permanently stored on storage devices
and are moved to memory when the computer actually uses them.
There are three main types of storage devices: Disk drives (hard
disks and floppy disks), CD drives (CD-R and CD-RW), and Tape
drives.
CPU
e.g., Disk, CD,
and Tape
Input
Devices
e.g., Keyboard,
Mouse
e.g., Monitor,
Printer
Communication
Devices
e.g., Modem,
and NIC
Storage
Devices
Memory
Output
Devices
Bus
https://www.facebook.com/Oxus20
7. Output Devices: Monitor
The monitor displays information (text and graphics). The resolution
and dot pitch determine the quality of the display.
CPU
e.g., Disk, CD,
and Tape
Input
Devices
e.g., Keyboard,
Mouse
e.g., Monitor,
Printer
Communication
Devices
e.g., Modem,
and NIC
Storage
Devices
Memory
Output
Devices
Bus
https://www.facebook.com/Oxus20
8. Communication Devices
A regular modem uses a phone line and can transfer data in a speed up to
56,000 bps (bits per second). A DSL (digital subscriber line) also uses a
phone line and can transfer data in a speed 20 times faster than a regular
modem. A cable modem uses the TV cable line maintained by the cable
company. A cable modem is as fast as a DSL. Network interface card
(NIC) is a device to connect a computer to a local area network (LAN).
The LAN is commonly used in business, universities, and government
organizations. A typical type of NIC, called 10BaseT, can transfer data at
10 mbps (million bits per second).
CPU
e.g., Disk, CD,
and Tape
Input
Devices
e.g., Keyboard,
Mouse
e.g., Monitor,
Printer
Communication
Devices
e.g., Modem,
and NIC
Storage
Devices
Memory
Output
Devices
Bus
https://www.facebook.com/Oxus20
9. Programs
Computer programs, known as software, are instructions
to the computer.
You tell a computer what to do through programs. Without
programs, a computer is an empty machine. Computers do
not understand human languages, so you need to use
computer languages to communicate with them.
Programs are written using programming languages.
https://www.facebook.com/Oxus20
10. Programming Languages
Machine Language Assembly Language High-Level Language
Machine language is a set of primitive instructions
built into every computer. The instructions are in
the form of binary code, so you have to enter binary
codes for various instructions. Program with native
machine language is a tedious process. Moreover
the programs are highly difficult to read and
modify. For example, to add two numbers, you
might write an instruction in binary like this:
1101101010011010
https://www.facebook.com/Oxus20
11. Programming Languages
Machine Language Assembly Language High-Level Language
Assembly languages were developed to make programming
easy. Since the computer cannot understand assembly
language, however, a program called assembler is used to
convert assembly language programs into machine code.
For example, to add two numbers, you might write an
instruction in assembly code like this:
ADDF3 R1, R2, R3
…
ADDF3 R1, R2, R3
…
Assembly Source File
Assembler …
1101101010011010
…
Machine Code File
https://www.facebook.com/Oxus20
12. Programming Languages
Machine Language Assembly Language High-Level Language
The high-level languages are English-like and easy to
learn and program. For example, the following is a high-
level language statement that computes the area of a circle
with radius 5:
area = 5 * 5 * 3.1415;
https://www.facebook.com/Oxus20
13. Popular High-Level Languages
»COBOL (COmmon Business Oriented Language)
»FORTRAN (FORmula TRANslation)
»BASIC (Beginner All-purpose Symbolic Instructional Code)
»Pascal (named for Blaise Pascal)
»Ada (named for Ada Lovelace)
»C (whose developer designed B first)
»Visual Basic (Basic-like visual language developed by Microsoft)
»Delphi (Pascal-like visual language developed by Borland)
»C++ (an object-oriented language, based on C)
»C# (a Java-like language developed by Microsoft)
»Java (We use it during the course)
https://www.facebook.com/Oxus20
14. Compiling Source Code
A program written in a high-level language is called a
source program. Since a computer cannot understand a
source program. Program called a compiler is used to
translate the source program into a machine language
program called an object program. The object program
is often then linked with other supporting library code
before the object can be executed on the machine.
CompilerSource File Machine-language
File
Linker Executable File
Library Code
https://www.facebook.com/Oxus20
15. Why Java?
The answer is that Java enables users to develop and
deploy applications on the Internet for servers, desktop
computers, and small hand-held devices. The future of
computing is being profoundly influenced by the Internet,
and Java promises to remain a big part of that future. Java
is the Internet programming language.
Java is a general purpose programming language.
Java is the Internet programming language.
https://www.facebook.com/Oxus20
16. Java, Web, and Beyond
» Java can be used to develop Web
applications.
» Java Applets
» Java Web Applications
» Java can also be used to develop applications
for hand-held devices such as Palm and cell
phones
https://www.facebook.com/Oxus20
17. Examples of Java’s Versatility (Applets)
https://www.facebook.com/Oxus20
18. PDA and Cell Phone
PDA
Cell Phone
https://www.facebook.com/Oxus20
19. Java’s History
» James Gosling and Sun Microsystems
» Oak
» Java, May 20, 1995, Sun World
» HotJava
˃ The first Java-enabled Web browser
» Early History Website:
http://java.sun.com/features/1998/05/birthday.html
https://www.facebook.com/Oxus20
20. Characteristics of Java
» Java Is Simple
» Java Is Object-Oriented
» Java Is Distributed
» Java Is Interpreted
» Java Is Robust ( full power and strong)
» Java Is Secure
» Java Is Architecture-Neutral
» Java Is Portable
» Java's Performance
» Java Is Multithreaded
» Java Is Dynamic
https://www.facebook.com/Oxus20
21. JDK: Java Development kit
» A package of software distributed by Sun
Microsystems for Java developers that
implements the basic set of tools needed to
write, test and debug Java applications and
applets.
https://www.facebook.com/Oxus20
22. JDK Versions
» JDK 1.02 (1995)
» JDK 1.1 (1996)
» JDK 1.2 (1998)
» JDK 1.3 (2000)
» JDK 1.4 (2002)
» JDK 1.5 (2004) a. k. a. JDK 5 or Java 5
» JDK 1.6 (2006) a. k. a. JDK 6 or Java 6
» JDK 1.7 (possibly 2010) a. k. a. JDK 7 or Java 7
https://www.facebook.com/Oxus20
23. JDK Editions
» Java Standard Edition (J2SE)
˃ J2SE can be used to develop client-side standalone
applications or applets.
» Java Enterprise Edition (J2EE)
˃ J2EE can be used to develop server-side applications such as
Java servlets and Java ServerPages.
» Java Micro Edition (J2ME).
˃ J2ME can be used to develop applications for mobile devices
such as cell phones.
https://www.facebook.com/Oxus20
24. Popular Java IDEs
» NetBeans Open Source by Sun
» Eclipse Open Source by IBM
https://www.facebook.com/Oxus20
25. A Simple Java Program
//This program prints Welcome to Java!
public class Welcome {
public static void main(String[] args) {
System.out.println("Welcome to first
Java program");
}
}
Result
Listing 1.1
https://www.facebook.com/Oxus20
26. Creating and Editing Using
NotePad
To use NotePad, type
notepad Welcome.java
from the DOS prompt.
https://www.facebook.com/Oxus20
27. Creating and Editing Using
WordPad
To use WordPad, type
write Welcome.java
from the DOS prompt.
https://www.facebook.com/Oxus20
28. //This program prints Welcome to Java!
public class Welcome {
public static void main(String[] args) {
System.out.println("Welcome to Java!");
}
}
Trace a Program Execution
Enter main method
https://www.facebook.com/Oxus20
29. //This program prints Welcome to Java!
public class Welcome {
public static void main(String[] args) {
System.out.println("Welcome to Java!");
}
}
Trace a Program Execution
Execute statement
https://www.facebook.com/Oxus20
30. //This program prints Welcome to Java!
public class Welcome {
public static void main(String[] args) {
System.out.println("Welcome to Java!");
}
}
Trace a Program Execution
print a message to the
console
https://www.facebook.com/Oxus20
31. Anatomy of a Java Program
» Comments
» Reserved words
» Modifiers
» Statements
» Blocks
» Classes
» Methods
» The main method
https://www.facebook.com/Oxus20
32. Comments
Line comment: A line comment is preceded by two
slashes (//) in a line.
Paragraph comment: A paragraph comment is
enclosed between /* and */ in one or multiple lines.
javadoc comment: javadoc comments begin with
/** and end with */. They are used for
documenting classes, data, and methods. They
can be extracted into an HTML file using JDK's
javadoc command.
Three types of comments in Java.
https://www.facebook.com/Oxus20
33. Reserved Words
Reserved words or keywords are words that have a
specific meaning to the compiler and cannot be
used for other purposes in the program. For
example, when the compiler sees the word class, it
understands that the word after class is the name
for the class. Other reserved words in Listing 1.1 are
public, static, and void. Their use will be introduced
later in the book.
https://www.facebook.com/Oxus20
34. Modifiers
Java uses certain reserved words called modifiers
that specify the properties of the data, methods,
and classes and how they can be used. Examples of
modifiers are public and static. Other modifiers are
private, final, abstract, and protected. A public
datum, method, or class can be accessed by other
programs. A private datum or method cannot be
accessed by other programs.
https://www.facebook.com/Oxus20
35. Statements
A statement represents an action or a sequence of
actions. The statement System.out.println("Welcome
to Java!") in the program in Listing 1.1 is a statement
to display the greeting "Welcome to Java!" Every
statement in Java ends with a semicolon (;).
https://www.facebook.com/Oxus20
36. Blocks
A pair of braces in a program forms a block that
groups components of a program.
public class Test {
public static void main(String[] args) {
System.out.println("Welcome to Java!");
}
}
Class block
Method block
https://www.facebook.com/Oxus20
37. Classes
The class is the essential Java construct. A class is a
template or blueprint for objects. To program in Java,
you must understand classes and be able to write and
use them. The mystery of the class will continue to be
unveiled throughout this book. For now, though,
understand that a program is defined by using one or
more classes.
https://www.facebook.com/Oxus20
38. Methods
What is System.out.println? It is a method: a
collection of statements that performs a sequence of
operations to display a message on the console. It can
be used even without fully understanding the details
of how it works. It is used by invoking a statement
with a string argument. The string argument is
enclosed within parentheses. In this case, the
argument is "Welcome to Java!" You can call the same
println method with a different argument to print a
different message.
https://www.facebook.com/Oxus20
39. main Method
The main method provides the control of program
flow. The Java interpreter executes the application by
invoking the main method.
The main method looks like this:
public static void main(String[] args) {
// Statements;
}
https://www.facebook.com/Oxus20
40. Displaying Text in a Message
Dialog Box
you can use the showMessageDialog method in the
JOptionPane class. JOptionPane is one of the many
predefined classes in the Java system, which can be
reused rather than “reinventing the wheel.”
https://www.facebook.com/Oxus20
42. Two Ways to Invoke the Method
There are several ways to use the
showMessageDialog method. For the time being, all
you need to know are two ways to invoke it.
One is to use a statement as shown in the example:
JOptionPane.showMessageDialog(null, x,
y, JOptionPane.INFORMATION_MESSAGE);
where x is a string for the text to be displayed, and y
is a string for the title of the message dialog box.
The other is to use a statement like this:
JOptionPane.showMessageDialog(null, x);
where x is a string for the text to be displayed.
https://www.facebook.com/Oxus20