This document provides an introduction to Java programming, covering topics such as object-oriented programming concepts in Java, primitive data types, control structures, predefined classes like Math and String, defining and using custom classes, and input/output using streams. It also describes key characteristics of Java like being platform independent and using a virtual machine model. The document is intended as a review for an appendix on Java fundamentals.
chapter 1-overview of java programming.pptxnafsigenet
This document provides an overview of the Java programming language. It discusses key characteristics of Java including that it is platform independent, object-oriented, and includes a core language and common packages. It also describes how Java source code is compiled to bytecode, executed by the Java Virtual Machine, and how classes and objects are defined and used in Java programs.
This document introduces Java programming concepts including object-oriented programming, primitive data types, control structures, predefined classes like Math and String, writing and documenting classes, and summarizing key characteristics of Java like being platform independent. It also covers topics like processing Java code, defining and using classes and objects, arrays, input/output streams, and more.
This document provides an introduction to Java programming including:
- An overview of object-oriented programming concepts in Java such as classes, objects, and inheritance.
- Descriptions of Java's primitive data types, control structures, and commonly used predefined classes.
- Explanations of how Java programs are compiled into bytecode and executed by the Java Virtual Machine.
- Details on how to write and document your own Java classes.
Scala is a programming language that combines object-oriented and functional programming. It runs on the Java Virtual Machine and is designed to grow with user demands through libraries. Play 2.0 is a web application framework written in Scala that allows for rapid development through its Model-View-Controller architecture and local development server. Cloud Foundry is an open Platform as a Service that allows developers to easily deploy and scale applications, including those written in Scala and Play 2.0.
- Java is an object-oriented programming language originally developed by Sun Microsystems that is both compiled and interpreted. Source code is compiled into bytecode, which is then run by the Java Virtual Machine (JVM) on any platform.
- Key features of Java include platform independence, security through sandboxing of applications, dynamic class loading, and versions for different uses including Java Micro Edition for small devices and Java Enterprise Edition for business applications.
- A Java program consists of classes that describe objects. Classes contain data fields and methods, and can extend existing classes. Commonly used classes are organized into packages.
The document outlines an agenda for learning core Java concepts over 15 sections. It introduces key Java topics like primitive data types, variables, arrays, control flow statements, classes and objects, inheritance, polymorphism, exceptions, strings and characters, files and streams, and generic collections. The agenda also covers defining classes and methods, passing arguments, encapsulation, and memory concepts like objects, references, and the heap.
This document provides an introduction to Java programming, covering topics such as object-oriented programming concepts in Java, primitive data types, control structures, predefined classes like Math and String, defining and using custom classes, and input/output using streams. It also describes key characteristics of Java like being platform independent and using a virtual machine model. The document is intended as a review for an appendix on Java fundamentals.
chapter 1-overview of java programming.pptxnafsigenet
This document provides an overview of the Java programming language. It discusses key characteristics of Java including that it is platform independent, object-oriented, and includes a core language and common packages. It also describes how Java source code is compiled to bytecode, executed by the Java Virtual Machine, and how classes and objects are defined and used in Java programs.
This document introduces Java programming concepts including object-oriented programming, primitive data types, control structures, predefined classes like Math and String, writing and documenting classes, and summarizing key characteristics of Java like being platform independent. It also covers topics like processing Java code, defining and using classes and objects, arrays, input/output streams, and more.
This document provides an introduction to Java programming including:
- An overview of object-oriented programming concepts in Java such as classes, objects, and inheritance.
- Descriptions of Java's primitive data types, control structures, and commonly used predefined classes.
- Explanations of how Java programs are compiled into bytecode and executed by the Java Virtual Machine.
- Details on how to write and document your own Java classes.
Scala is a programming language that combines object-oriented and functional programming. It runs on the Java Virtual Machine and is designed to grow with user demands through libraries. Play 2.0 is a web application framework written in Scala that allows for rapid development through its Model-View-Controller architecture and local development server. Cloud Foundry is an open Platform as a Service that allows developers to easily deploy and scale applications, including those written in Scala and Play 2.0.
- Java is an object-oriented programming language originally developed by Sun Microsystems that is both compiled and interpreted. Source code is compiled into bytecode, which is then run by the Java Virtual Machine (JVM) on any platform.
- Key features of Java include platform independence, security through sandboxing of applications, dynamic class loading, and versions for different uses including Java Micro Edition for small devices and Java Enterprise Edition for business applications.
- A Java program consists of classes that describe objects. Classes contain data fields and methods, and can extend existing classes. Commonly used classes are organized into packages.
The document outlines an agenda for learning core Java concepts over 15 sections. It introduces key Java topics like primitive data types, variables, arrays, control flow statements, classes and objects, inheritance, polymorphism, exceptions, strings and characters, files and streams, and generic collections. The agenda also covers defining classes and methods, passing arguments, encapsulation, and memory concepts like objects, references, and the heap.
Java is a high level, an object oriented and mostly used programming language. It has several applications as in web development, app development, android development etc. This is a ppt that will give a basic idea about java its uses and its applications.
02._Object-Oriented_Programming_Concepts.pptYonas D. Ebren
This document discusses object-oriented programming concepts and provides an example of analyzing a software development process using object-oriented principles. It describes a typical 5-step software development process of analysis, design, implementation, testing, and maintenance. It then introduces object-oriented programming concepts like modeling a problem as a set of collaborating objects and components. As an example, it analyzes the classic game Tetris in terms of its objects like pieces and boards, their properties and capabilities.
The document discusses Java programming concepts like comments, classes, methods, and user input. It provides explanations and examples of:
1) How comments are used in Java and the different types of comments.
2) The basic structure of a Java class including the main method that acts as the entry point.
3) How the System.out.println method prints output and how user input can be accepted using the Scanner class.
Java is a popular object-oriented programming language. It was developed by Sun Microsystems in 1995 and is considered a robust, secure, and portable language. Some key features of Java include being platform independent, object-oriented, and having automatic memory management. Java code is compiled to bytecode that runs on a Java Virtual Machine (JVM). The JRE provides the runtime environment for Java applications. Common applications of Java include desktop programs, web applications, and enterprise software. Objects in Java are instances of classes that have state and behavior.
Java is an object-oriented programming language developed by Sun Microsystems to be small, simple, and portable across platforms. It uses classes and objects, inheritance, interfaces, and packages. A class is a template that defines objects, which are instances of a class. Inheritance allows classes to inherit attributes and behaviors from parent classes. Interfaces define behaviors without implementations. Packages organize related classes.
This document provides an overview of object oriented programming concepts in Java including classes, objects, encapsulation, inheritance, polymorphism and more. It also outlines the syllabus for a course on OOP with Java, covering topics like arrays, strings, vectors, exception handling, GUI programming and more. Finally, it provides some examples of basic Java code.
This document describes stacks and queues data structures and their application programming interfaces (APIs). It defines the common operations for stacks and queues, including push, pop, enqueue, and dequeue. It provides examples of using stacks and queues to evaluate postfix expressions and read input from a queue. Stacks and queues are widely used in applications like browsers, interpreters, and printing. The document also covers generics, autoboxing/unboxing, and real-world examples of stacks in programming languages and PostScript.
Vibrant Technologies is headquarted in Mumbai,India.We are the best Java training provider in Navi Mumbai who provides Live Projects to students.We provide Corporate Training also.We are Best Java classes in Mumbai according to our students and corporators
Contact Us On : http://vibranttechnologies.co.in/
This document provides an overview of object-oriented programming fundamentals in Java, including basic concepts like objects, classes, inheritance, polymorphism, and encapsulation. It discusses Java features, the Java program structure, variables and data types, operators, expressions, arrays, and control statements. Object-oriented programming concepts like abstraction, encapsulation, inheritance and polymorphism are explained. The benefits and applications of OOP are also highlighted.
Scala: Object-Oriented Meets Functional, by Iulian Dragos3Pillar Global
A presentation from Iulian Dragos of Typesafe that gives an overview of the Scala programming language. The presentation was given at a Functional Angle conference in Timisoara, Romania sponsored by 3Pillar. Iulian Dragos has been working on Scala since 2004. He currently works for Typesafe, a start-up that was co-founded by Scala’s creator, Martin Odersky.
A web browser takes you anywhere on the internet, letting you see text, images and video from anywhere in the world. ... The web is a vast and powerful tool. Over .
This document provides an introduction to using Java for FIRST Robotics Competition robotics programs. It covers key Java concepts like classes, objects, inheritance, and exceptions. It also discusses how to install Java and the necessary plugins for FRC, create a basic robot program, and display diagnostic output. The document compares the SimpleRobot and IterativeRobot templates and gives examples of common Java code for FRC robotics.
This document discusses several core Java concepts including comments, classes, objects, scopes, static methods and fields, arrays, and constructors. It provides examples of Java code for classes, methods, and constructors. Key points covered include: javadoc comments generate API documentation; classes describe data and operations on objects; scopes are determined by curly braces; static methods and fields belong to the class not instances; arrays are objects that can be dynamically allocated; and constructors create class instances and invoke superclass constructors.
ZeroSpace is a part of Woxa Technology where industrial trainer are ready to trained you.Take a demo class and choose your future in the programming field. We offer to learn in latest technology with live project which is demanding.
feel free to contact us-: 8471003400
Woxa Technologies have great industrial exoerts in java field they work on the live projects with students they are not teacher they are industrial trainer.
for more information 8471003400
This document provides an overview of Java programming concepts covered in a course. It discusses:
- Sections of the course covering topics like Applets, Multithreading, AWT, Swing, Networking and JDBC.
- A brief history of Java and its versions.
- Core Java concepts like objects, classes, inheritance, interfaces, strings and exceptions.
- Other features like being platform independent, secure, robust and portable.
- Data types, operators, methods, constructors, access modifiers and this keyword in Java.
Java , basics of java programming, JVM, JRE, JDK detailed explanation. primitive datatype. this ppt explains the basic concepts of java clearly starting from variables to complex programmes. It has 55 slides which gives you better understanding
Part 2 Deep Dive: Navigating the 2024 Slowdownjeffkluth1
Introduction
The global retail industry has weathered numerous storms, with the financial crisis of 2008 serving as a poignant reminder of the sector's resilience and adaptability. However, as we navigate the complex landscape of 2024, retailers face a unique set of challenges that demand innovative strategies and a fundamental shift in mindset. This white paper contrasts the impact of the 2008 recession on the retail sector with the current headwinds retailers are grappling with, while offering a comprehensive roadmap for success in this new paradigm.
Call8328958814 satta matka Kalyan result satta guessing➑➌➋➑➒➎➑➑➊➍
Satta Matka Kalyan Main Mumbai Fastest Results
Satta Matka ❋ Sattamatka ❋ New Mumbai Ratan Satta Matka ❋ Fast Matka ❋ Milan Market ❋ Kalyan Matka Results ❋ Satta Game ❋ Matka Game ❋ Satta Matka ❋ Kalyan Satta Matka ❋ Mumbai Main ❋ Online Matka Results ❋ Satta Matka Tips ❋ Milan Chart ❋ Satta Matka Boss❋ New Star Day ❋ Satta King ❋ Live Satta Matka Results ❋ Satta Matka Company ❋ Indian Matka ❋ Satta Matka 143❋ Kalyan Night Matka..
Java is a high level, an object oriented and mostly used programming language. It has several applications as in web development, app development, android development etc. This is a ppt that will give a basic idea about java its uses and its applications.
02._Object-Oriented_Programming_Concepts.pptYonas D. Ebren
This document discusses object-oriented programming concepts and provides an example of analyzing a software development process using object-oriented principles. It describes a typical 5-step software development process of analysis, design, implementation, testing, and maintenance. It then introduces object-oriented programming concepts like modeling a problem as a set of collaborating objects and components. As an example, it analyzes the classic game Tetris in terms of its objects like pieces and boards, their properties and capabilities.
The document discusses Java programming concepts like comments, classes, methods, and user input. It provides explanations and examples of:
1) How comments are used in Java and the different types of comments.
2) The basic structure of a Java class including the main method that acts as the entry point.
3) How the System.out.println method prints output and how user input can be accepted using the Scanner class.
Java is a popular object-oriented programming language. It was developed by Sun Microsystems in 1995 and is considered a robust, secure, and portable language. Some key features of Java include being platform independent, object-oriented, and having automatic memory management. Java code is compiled to bytecode that runs on a Java Virtual Machine (JVM). The JRE provides the runtime environment for Java applications. Common applications of Java include desktop programs, web applications, and enterprise software. Objects in Java are instances of classes that have state and behavior.
Java is an object-oriented programming language developed by Sun Microsystems to be small, simple, and portable across platforms. It uses classes and objects, inheritance, interfaces, and packages. A class is a template that defines objects, which are instances of a class. Inheritance allows classes to inherit attributes and behaviors from parent classes. Interfaces define behaviors without implementations. Packages organize related classes.
This document provides an overview of object oriented programming concepts in Java including classes, objects, encapsulation, inheritance, polymorphism and more. It also outlines the syllabus for a course on OOP with Java, covering topics like arrays, strings, vectors, exception handling, GUI programming and more. Finally, it provides some examples of basic Java code.
This document describes stacks and queues data structures and their application programming interfaces (APIs). It defines the common operations for stacks and queues, including push, pop, enqueue, and dequeue. It provides examples of using stacks and queues to evaluate postfix expressions and read input from a queue. Stacks and queues are widely used in applications like browsers, interpreters, and printing. The document also covers generics, autoboxing/unboxing, and real-world examples of stacks in programming languages and PostScript.
Vibrant Technologies is headquarted in Mumbai,India.We are the best Java training provider in Navi Mumbai who provides Live Projects to students.We provide Corporate Training also.We are Best Java classes in Mumbai according to our students and corporators
Contact Us On : http://vibranttechnologies.co.in/
This document provides an overview of object-oriented programming fundamentals in Java, including basic concepts like objects, classes, inheritance, polymorphism, and encapsulation. It discusses Java features, the Java program structure, variables and data types, operators, expressions, arrays, and control statements. Object-oriented programming concepts like abstraction, encapsulation, inheritance and polymorphism are explained. The benefits and applications of OOP are also highlighted.
Scala: Object-Oriented Meets Functional, by Iulian Dragos3Pillar Global
A presentation from Iulian Dragos of Typesafe that gives an overview of the Scala programming language. The presentation was given at a Functional Angle conference in Timisoara, Romania sponsored by 3Pillar. Iulian Dragos has been working on Scala since 2004. He currently works for Typesafe, a start-up that was co-founded by Scala’s creator, Martin Odersky.
A web browser takes you anywhere on the internet, letting you see text, images and video from anywhere in the world. ... The web is a vast and powerful tool. Over .
This document provides an introduction to using Java for FIRST Robotics Competition robotics programs. It covers key Java concepts like classes, objects, inheritance, and exceptions. It also discusses how to install Java and the necessary plugins for FRC, create a basic robot program, and display diagnostic output. The document compares the SimpleRobot and IterativeRobot templates and gives examples of common Java code for FRC robotics.
This document discusses several core Java concepts including comments, classes, objects, scopes, static methods and fields, arrays, and constructors. It provides examples of Java code for classes, methods, and constructors. Key points covered include: javadoc comments generate API documentation; classes describe data and operations on objects; scopes are determined by curly braces; static methods and fields belong to the class not instances; arrays are objects that can be dynamically allocated; and constructors create class instances and invoke superclass constructors.
ZeroSpace is a part of Woxa Technology where industrial trainer are ready to trained you.Take a demo class and choose your future in the programming field. We offer to learn in latest technology with live project which is demanding.
feel free to contact us-: 8471003400
Woxa Technologies have great industrial exoerts in java field they work on the live projects with students they are not teacher they are industrial trainer.
for more information 8471003400
This document provides an overview of Java programming concepts covered in a course. It discusses:
- Sections of the course covering topics like Applets, Multithreading, AWT, Swing, Networking and JDBC.
- A brief history of Java and its versions.
- Core Java concepts like objects, classes, inheritance, interfaces, strings and exceptions.
- Other features like being platform independent, secure, robust and portable.
- Data types, operators, methods, constructors, access modifiers and this keyword in Java.
Java , basics of java programming, JVM, JRE, JDK detailed explanation. primitive datatype. this ppt explains the basic concepts of java clearly starting from variables to complex programmes. It has 55 slides which gives you better understanding
Part 2 Deep Dive: Navigating the 2024 Slowdownjeffkluth1
Introduction
The global retail industry has weathered numerous storms, with the financial crisis of 2008 serving as a poignant reminder of the sector's resilience and adaptability. However, as we navigate the complex landscape of 2024, retailers face a unique set of challenges that demand innovative strategies and a fundamental shift in mindset. This white paper contrasts the impact of the 2008 recession on the retail sector with the current headwinds retailers are grappling with, while offering a comprehensive roadmap for success in this new paradigm.
Call8328958814 satta matka Kalyan result satta guessing➑➌➋➑➒➎➑➑➊➍
Satta Matka Kalyan Main Mumbai Fastest Results
Satta Matka ❋ Sattamatka ❋ New Mumbai Ratan Satta Matka ❋ Fast Matka ❋ Milan Market ❋ Kalyan Matka Results ❋ Satta Game ❋ Matka Game ❋ Satta Matka ❋ Kalyan Satta Matka ❋ Mumbai Main ❋ Online Matka Results ❋ Satta Matka Tips ❋ Milan Chart ❋ Satta Matka Boss❋ New Star Day ❋ Satta King ❋ Live Satta Matka Results ❋ Satta Matka Company ❋ Indian Matka ❋ Satta Matka 143❋ Kalyan Night Matka..
Best practices for project execution and deliveryCLIVE MINCHIN
A select set of project management best practices to keep your project on-track, on-cost and aligned to scope. Many firms have don't have the necessary skills, diligence, methods and oversight of their projects; this leads to slippage, higher costs and longer timeframes. Often firms have a history of projects that simply failed to move the needle. These best practices will help your firm avoid these pitfalls but they require fortitude to apply.
[To download this presentation, visit:
https://www.oeconsulting.com.sg/training-presentations]
This PowerPoint compilation offers a comprehensive overview of 20 leading innovation management frameworks and methodologies, selected for their broad applicability across various industries and organizational contexts. These frameworks are valuable resources for a wide range of users, including business professionals, educators, and consultants.
Each framework is presented with visually engaging diagrams and templates, ensuring the content is both informative and appealing. While this compilation is thorough, please note that the slides are intended as supplementary resources and may not be sufficient for standalone instructional purposes.
This compilation is ideal for anyone looking to enhance their understanding of innovation management and drive meaningful change within their organization. Whether you aim to improve product development processes, enhance customer experiences, or drive digital transformation, these frameworks offer valuable insights and tools to help you achieve your goals.
INCLUDED FRAMEWORKS/MODELS:
1. Stanford’s Design Thinking
2. IDEO’s Human-Centered Design
3. Strategyzer’s Business Model Innovation
4. Lean Startup Methodology
5. Agile Innovation Framework
6. Doblin’s Ten Types of Innovation
7. McKinsey’s Three Horizons of Growth
8. Customer Journey Map
9. Christensen’s Disruptive Innovation Theory
10. Blue Ocean Strategy
11. Strategyn’s Jobs-To-Be-Done (JTBD) Framework with Job Map
12. Design Sprint Framework
13. The Double Diamond
14. Lean Six Sigma DMAIC
15. TRIZ Problem-Solving Framework
16. Edward de Bono’s Six Thinking Hats
17. Stage-Gate Model
18. Toyota’s Six Steps of Kaizen
19. Microsoft’s Digital Transformation Framework
20. Design for Six Sigma (DFSS)
To download this presentation, visit:
https://www.oeconsulting.com.sg/training-presentations
❼❷⓿❺❻❷❽❷❼❽ Dpboss Matka Result Satta Matka Guessing Satta Fix jodi Kalyan Final ank Satta Matka Dpbos Final ank Satta Matta Matka 143 Kalyan Matka Guessing Final Matka Final ank Today Matka 420 Satta Batta Satta 143 Kalyan Chart Main Bazar Chart vip Matka Guessing Dpboss 143 Guessing Kalyan night
IMPACT Silver is a pure silver zinc producer with over $260 million in revenue since 2008 and a large 100% owned 210km Mexico land package - 2024 catalysts includes new 14% grade zinc Plomosas mine and 20,000m of fully funded exploration drilling.
Dive into this presentation and learn about the ways in which you can buy an engagement ring. This guide will help you choose the perfect engagement rings for women.
NIMA2024 | De toegevoegde waarde van DEI en ESG in campagnes | Nathalie Lam |...BBPMedia1
Nathalie zal delen hoe DEI en ESG een fundamentele rol kunnen spelen in je merkstrategie en je de juiste aansluiting kan creëren met je doelgroep. Door middel van voorbeelden en simpele handvatten toont ze hoe dit in jouw organisatie toegepast kan worden.
How are Lilac French Bulldogs Beauty Charming the World and Capturing Hearts....Lacey Max
“After being the most listed dog breed in the United States for 31
years in a row, the Labrador Retriever has dropped to second place
in the American Kennel Club's annual survey of the country's most
popular canines. The French Bulldog is the new top dog in the
United States as of 2022. The stylish puppy has ascended the
rankings in rapid time despite having health concerns and limited
color choices.”
HR search is critical to a company's success because it ensures the correct people are in place. HR search integrates workforce capabilities with company goals by painstakingly identifying, screening, and employing qualified candidates, supporting innovation, productivity, and growth. Efficient talent acquisition improves teamwork while encouraging collaboration. Also, it reduces turnover, saves money, and ensures consistency. Furthermore, HR search discovers and develops leadership potential, resulting in a strong pipeline of future leaders. Finally, this strategic approach to recruitment enables businesses to respond to market changes, beat competitors, and achieve long-term success.
Brian Fitzsimmons on the Business Strategy and Content Flywheel of Barstool S...Neil Horowitz
On episode 272 of the Digital and Social Media Sports Podcast, Neil chatted with Brian Fitzsimmons, Director of Licensing and Business Development for Barstool Sports.
What follows is a collection of snippets from the podcast. To hear the full interview and more, check out the podcast on all podcast platforms and at www.dsmsports.net
Cover Story - China's Investment Leader - Dr. Alyce SUmsthrill
In World Expo 2010 Shanghai – the most visited Expo in the World History
https://www.britannica.com/event/Expo-Shanghai-2010
China’s official organizer of the Expo, CCPIT (China Council for the Promotion of International Trade https://en.ccpit.org/) has chosen Dr. Alyce Su as the Cover Person with Cover Story, in the Expo’s official magazine distributed throughout the Expo, showcasing China’s New Generation of Leaders to the World.
Anny Serafina Love - Letter of Recommendation by Kellen Harkins, MS.AnnySerafinaLove
This letter, written by Kellen Harkins, Course Director at Full Sail University, commends Anny Love's exemplary performance in the Video Sharing Platforms class. It highlights her dedication, willingness to challenge herself, and exceptional skills in production, editing, and marketing across various video platforms like YouTube, TikTok, and Instagram.
The APCO Geopolitical Radar - Q3 2024 The Global Operating Environment for Bu...APCO
The Radar reflects input from APCO’s teams located around the world. It distils a host of interconnected events and trends into insights to inform operational and strategic decisions. Issues covered in this edition include:
SATTA MATKA SATTA FAST RESULT KALYAN TOP MATKA RESULT KALYAN SATTA MATKA FAST RESULT MILAN RATAN RAJDHANI MAIN BAZAR MATKA FAST TIPS RESULT MATKA CHART JODI CHART PANEL CHART FREE FIX GAME SATTAMATKA ! MATKA MOBI SATTA 143 spboss.in TOP NO1 RESULT FULL RATE MATKA ONLINE GAME PLAY BY APP SPBOSS
Best Competitive Marble Pricing in Dubai - ☎ 9928909666Stone Art Hub
Stone Art Hub offers the best competitive Marble Pricing in Dubai, ensuring affordability without compromising quality. With a wide range of exquisite marble options to choose from, you can enhance your spaces with elegance and sophistication. For inquiries or orders, contact us at ☎ 9928909666. Experience luxury at unbeatable prices.
2. Appendix A: Introduction to Java 2
Topics of the Review
• Essentials of object-oriented programming, in Java
• Java primitive data types, control structures, and arrays
• Using some predefined classes:
• Math
• JOptionPane, I/O streams
• String, StringBuffer, StringBuilder
• StringTokenizer
• Writing and documenting your own Java classes
3. Appendix A: Introduction to Java 3
Some Salient Characteristics of Java
• Java is platform independent: the same program can
run on any correctly implemented Java system
• Java is object-oriented:
• Structured in terms of classes, which group data with
operations on that data
• Can construct new classes by extending existing ones
• Java designed as
• A core language plus
• A rich collection of commonly available packages
• Java can be embedded in Web pages
4. Appendix A: Introduction to Java 4
Java Processing and Execution
• Begin with Java source code in text files: Model.java
• A Java source code compiler produces Java byte code
• Outputs one file per class: Model.class
• May be standalone or part of an IDE
• A Java Virtual Machine loads and executes class files
• May compile them to native code (e.g., x86) internally
6. Appendix A: Introduction to Java 6
Classes and Objects
• The class is the unit of programming
• A Java program is a collection of classes
• Each class definition (usually) in its own .java file
• The file name must match the class name
• A class describes objects (instances)
• Describes their common characteristics: is a blueprint
• Thus all the instances have these same characteristics
• These characteristics are:
• Data fields for each object
• Methods (operations) that do work on the objects
7. Appendix A: Introduction to Java 7
Grouping Classes: The Java API
• API = Application Programming Interface
• Java = small core + extensive collection of packages
• A package consists of some related Java classes:
• Swing: a GUI (graphical user interface) package
• AWT: Application Window Toolkit (more GUI)
• util: utility data structures (important to CS 187!)
• The import statement tells the compiler to make
available classes and methods of another package
• A main method indicates where to begin executing a
class (if it is designed to be run as a program)
8. Appendix A: Introduction to Java 8
A Little Example of import and main
import javax.swing.*;
// all classes from javax.swing
public class HelloWorld { // starts a class
public static void main (String[] args) {
// starts a main method
// in: array of String; out: none (void)
}
}
• public = can be seen from any package
• static = not “part of” an object
9. Appendix A: Introduction to Java 9
Processing and Running HelloWorld
• javac HelloWorld.java
• Produces HelloWorld.class (byte code)
• java HelloWorld
• Starts the JVM and runs the main method
10. Appendix A: Introduction to Java 10
References and Primitive Data Types
• Java distinguishes two kinds of entities
• Primitive types
• Objects
• Primitive-type data is stored in primitive-type variables
• Reference variables store the address of an object
• No notion of “object (physically) in the stack”
• No notion of “object (physically) within an object”
11. Appendix A: Introduction to Java 11
Primitive Data Types
• Represent numbers, characters, boolean values
• Integers: byte, short, int, and long
• Real numbers: float and double
• Characters: char
12. Appendix A: Introduction to Java 12
Primitive Data Types
Data type Range of values
byte -128 .. 127 (8 bits)
short -32,768 .. 32,767 (16 bits)
int -2,147,483,648 .. 2,147,483,647 (32 bits)
long -9,223,372,036,854,775,808 .. ... (64 bits)
float +/-10-38 to +/-10+38 and 0, about 6 digits precision
double +/-10-308 to +/-10+308 and 0, about 15 digits precision
char Unicode characters (generally 16 bits per char)
boolean True or false
16. Appendix A: Introduction to Java 16
Type Compatibility and Conversion
• Widening conversion:
• In operations on mixed-type operands, the numeric
type of the smaller range is converted to the numeric
type of the larger range
• In an assignment, a numeric type of smaller range
can be assigned to a numeric type of larger range
• byte to short to int to long
• int kind to float to double
17. Appendix A: Introduction to Java 17
Declaring and Setting Variables
• int square;
square = n * n;
• double cube = n * (double)square;
• Can generally declare local variables where they are
initialized
• All variables get a safe initial value anyway (zero/null)
18. Appendix A: Introduction to Java 18
Referencing and Creating Objects
• You can declare reference variables
• They reference objects of specified types
• Two reference variables can reference the same object
• The new operator creates an instance of a class
• A constructor executes when a new object is created
• Example: String greeting = ″hello″;
19. Appendix A: Introduction to Java 19
Java Control Statements
• A group of statements executed in order is written
• { stmt1; stmt2; ...; stmtN; }
• The statements execute in the order 1, 2, ..., N
• Control statements alter this sequential flow of execution
22. Appendix A: Introduction to Java 22
Methods
• A Java method defines a group of statements as
performing a particular operation
• static indicates a static or class method
• A method that is not static is an instance method
• All method arguments are call-by-value
• Primitive type: value is passed to the method
• Method may modify local copy but will not affect
caller’s value
• Object reference: address of object is passed
• Change to reference variable does not affect caller
• But operations can affect the object, visible to caller
24. Appendix A: Introduction to Java 24
Escape Sequences
• An escape sequence is a sequence of two characters
beginning with the character
• A way to represents special characters/symbols
25. Appendix A: Introduction to Java 25
The String Class
• The String class defines a data type that is used to
store a sequence of characters
• You cannot modify a String object
• If you attempt to do so, Java will create a new object
that contains the modified character sequence
26. Appendix A: Introduction to Java 26
Comparing Objects
• You can’t use the relational or equality operators to
compare the values stored in strings (or other objects)
(You will compare the pointers, not the objects!)
27. Appendix A: Introduction to Java 27
The StringBuffer Class
• Stores character sequences
• Unlike a String object, you can change the contents of
a StringBuffer object
28. Appendix A: Introduction to Java 28
StringTokenizer Class
• We often need to process individual pieces, or tokens, of
a String
29. Appendix A: Introduction to Java 29
Wrapper Classes for Primitive Types
• Sometimes we need to process primitive-type data as
objects
• Java provides a set of classes called wrapper classes
whose objects contain primitive-type values: Float,
Double, Integer, Boolean, Character, etc.
30. Appendix A: Introduction to Java 30
Defining Your Own Classes
• Unified Modeling Language (UML) is a standard diagram
notation for describing a class
Class
name
Field
values
Class
name
Field
signatures:
type and name
Method signatures:
name, argument
types, result type
31. Appendix A: Introduction to Java 31
Defining Your Own Classes (continued)
• The modifier private limits access to just this class
• Only class members with public visibility can be
accessed outside of the class* (* but see protected)
• Constructors initialize the data fields of an instance
32. Appendix A: Introduction to Java 32
The Person Class
// we have omitted javadoc to save space
public class Person {
private String givenName;
private String familyName;
private String IDNumber;
private int birthYear;
private static final int VOTE_AGE = 18;
private static final int SENIOR_AGE = 65;
...
33. Appendix A: Introduction to Java 33
The Person Class (2)
// constructors: fill in new objects
public Person(String first, String family,
String ID, int birth) {
this.givenName = first;
this.familyName = family;
this.IDNumber = ID;
this.birthYear = birth;
}
public Person (String ID) {
this.IDNumber = ID;
}
34. Appendix A: Introduction to Java 34
The Person Class (3)
// modifier and accessor for givenName
public void setGivenName (String given) {
this.givenName = given;
}
public String getGivenName () {
return this.givenName;
}
35. Appendix A: Introduction to Java 35
The Person Class (4)
// more interesting methods ...
public int age (int inYear) {
return inYear – birthYear;
}
public boolean canVote (int inYear) {
int theAge = age(inYear);
return theAge >= VOTE_AGE;
}
36. Appendix A: Introduction to Java 36
The Person Class (5)
// “printing” a Person
public String toString () {
return “Given name: “ + givenName + “n”
+ “Family name: “ + familyName + “n”
+ “ID number: “ + IDNumber + “n”
+ “Year of birth: “ + birthYear + “n”;
}
37. Appendix A: Introduction to Java 37
The Person Class (6)
// same Person?
public boolean equals (Person per) {
return (per == null) ? false :
this.IDNumber.equals(per.IDNumber);
}
38. Appendix A: Introduction to Java 38
Arrays
• In Java, an array is also an object
• The elements are indexes and are referenced using the
form arrayvar[subscript]
39. Appendix A: Introduction to Java 39
Array Example
float grades[] = new float[numStudents];
... grades[student] = something; ...
float total = 0.0;
for (int i = 0; i < grades.length; ++i) {
total += grades[i];
}
System.out.printf(“Average = %6.2f%n”,
total / numStudents);
40. Appendix A: Introduction to Java 40
Array Example Variations
// possibly more efficient
for (int i = grades.length; --i >= 0; ) {
total += grades[i];
}
// uses Java 5.0 “for each” looping
for (float grade : grades) {
total += grade;
}
41. Appendix A: Introduction to Java 41
Input/Output using Class JOptionPane
• Java 1.2 and higher provide class JOptionPane, which
facilitates display
• Dialog windows for input
• Message windows for output
43. Appendix A: Introduction to Java 43
Converting Numeric Strings to Numbers
• A dialog window always returns a reference to a String
• Therefore, a conversion is required, using static
methods of class String:
44. Appendix A: Introduction to Java 44
Input/Output using Streams
• An InputStream is a sequence of characters
representing program input data
• An OutputStream is a sequence of characters
representing program output
• The console keyboard stream is System.in
• The console window is associated with System.out
45. Appendix A: Introduction to Java 45
Opening and Using Files: Reading Input
import java.io.*;
public static void main (String[] args) {
// open an input stream (**exceptions!)
BufferedReader rdr =
new BufferedReader(
new FileReader(args[0]));
// read a line of input
String line = rdr.readLine();
// see if at end of file
if (line == null) { ... }
46. Appendix A: Introduction to Java 46
Opening and Using Files: Reading Input (2)
// using input with StringTokenizer
StringTokenizer sTok =
new StringTokenizer (line);
while (sTok.hasMoreElements()) {
String token = sTok.nextToken();
...;
}
// when done, always close a stream/reader
rdr.close();
47. Appendix A: Introduction to Java 47
Alternate Ways to Split a String
• Use the split method of String:
String[] = s.split(“s”);
// see class Pattern in java.util.regex
• Use a StreamTokenizer (in java.io)
48. Appendix A: Introduction to Java 48
Opening and Using Files: Writing Output
// open a print stream (**exceptions!)
PrintStream ps = new PrintStream(args[0]);
// ways to write output
ps.print(“Hello”); // a string
ps.print(i+3); // an integer
ps.println(“ and goodbye.”); // with NL
ps.printf(“%2d %12d%n”, i, 1<<i); // like C
ps.format(“%2d %12d%n”, i, 1<<i); // same
// closing output streams is very important!
ps.close();
49. Appendix A: Introduction to Java 49
Summary of the Review
• A Java program is a collection of classes
• The JVM approach enables a Java program written on
one machine to execute on any other machine that has a
JVM
• Java defines a set of primitive data types that are used
to represent numbers, characters, and boolean data
• The control structures of Java are similar to those found
in other languages
• The Java String and StringBuffer classes are used
to reference objects that store character strings
50. Appendix A: Introduction to Java 50
Chapter Review (continued)
• Be sure to use methods such as equals and
compareTo to compare the contents of String objects
• You can declare your own Java classes and create
objects of these classes using the new operator
• A class has data fields and instance methods
• Array variables can reference array objects
• Class JOptionPane can be used to display dialog
windows for data entry and message windows for output
• The stream classes in package java.io read strings
from the console and display strings to the console, and
also support file I/O