TAILIEUCHUNG - Lecture An Introduction to Object-Oriented Programming with Java (4/e): Chapter 2 - C. Thomas Wu

Chapter 2 - Getting started with Java. After you have read and studied this chapter, you should be able to: Identify the basic components of Java programs; write simple Java programs; describe the difference between object declaration and creation; describe the process of creating and running Java programs; use the Date, SimpleDateFormat, String, and Scanner standard classes; develop Java programs, using the incremental development approach. | Chapter 2 Getting Started with Java 4th Ed Chapter 2 - ©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Objectives After you have read and studied this chapter, you should be able to Identify the basic components of Java programs Write simple Java programs Describe the difference between object declaration and creation Describe the process of creating and running Java programs Use the Date, SimpleDateFormat, String, and JOptionPane standard classes Develop Java programs, using the incremental development approach 4th Ed Chapter 2 - ©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. The First Java Program The fundamental OOP concept illustrated by the program: An object-oriented program uses objects. This program displays a window on the screen. The size of the window is set to 300 pixels wide and 200 pixels high. Its title is set to My First Java Program. 4th Ed Chapter 2 - ©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. It’s kind of obvious, but the most fundamental important concept in OOP is the use of objects in a program. We will illustrate this key concept in the first sample program. The program, when executed, will display a window on the screen. The text displayed in the window’s title bar will be My First Java Program. The size of the window is set to 300 pixels wide and 200 pixels high. Program Ch2Sample1 import .*; class Ch2Sample1 { public static void main(String[ ] args) { JFrame myWindow; myWindow = new JFrame( ); (300, 200); (“My First Java Program”); (true); } } Declare a name Create an object Use an object 4th Ed Chapter 2 - ©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Based on what you learned about objects in the previous lessons and the description of the program in previous slide, can you make some sense from this program code? The .

TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.