... NGÔN NGỮ LẬP TRÌNH JAVA 7 Mở đầu 7 Giới thiệu về ngôn ngữ lập trình Java 7 Java là gì? 7 Lịch sử phát triển của ngôn ngữ lập trình Java 7 Một số đặc điểm nổi bậc của ngôn ngữ lập trình Java 8 1.3 ... thành “java shooter” Một số vấn đề nâng trong ngôn ngữ lập trình java như: javabean, thiết kết giao diện dùng thư viện JFC(Java Foundation Class), lập trình mạng, lập trình cơ sở dữ liệu bằng java, ... thức cơ bản liên quan đến việc lập trình ứng dụng bằng ngôn ngữ Java như: lịch sử phát triển của java, các đặc điểm của java, khái niệm máy ảo, cấu trúc của một chương trình đơn giản viết bằng Java
Ngày tải lên: 04/07/2016, 07:51
GIÁO TRÌNH JAVA cơ bản
... Applet Java trên Web Tập mã nhị phân Java Máy ảo Java Trang 2 Hãng Microsoft thấy được tính ưu việt của Java nên đã bắt tay xây dựng môitrình lập trình cho ngôn ngữ này Sau khi đã mua bản quyền, ... đó có chứa “máy ảo Java” Máy ảo Java l à một tập các quy ước về chỉ thị, dạng thức l ưu trữ,thanh ghi v.v như máy tính th ực sự và trình thông dịch Java tạo ra máy ảo Java này Trình thông dịch ... Ngôn ngữ Java khác các ngôn ngữ bi ên dịch khác ở những điểm n ào? 2 Thế nào là máy ảo Java? 3 Nói rằng Visual j ++6.0 là ngôn ngữ Java, đúng hay sai? 4 Thế nào là trình duyệt có khả năng Java?
Ngày tải lên: 03/02/2015, 09:21
Giáo trình Java cơ bản 01
... programming using the Java language To gain experience in engineering reliable programs Trang 5… in particular OOJ/OJA and IPJ/IJA have been designed to form the core of Java programming They ... Trang 1Welcome to Object-Oriented Programming Using Java Trang 3► Subject Information Trang 41/4 Subject aims To understand how computers work ... IPJ/IJA have been designed to form the core of Java programming They provide a solid foundation for Java application development Trang 61/6 Teaching philosophy Learning is an active process The
Ngày tải lên: 24/03/2016, 22:01
Giáo trình Java cơ bản 02
... Trang 35Running Java programs Java compilation process Java execution process – Java byte code is read and executed via a Java byte code interpreter Program written in Java Java byte code ... run Java programs in Unix To create a file > vi <filename> Note: to create a Java program the filename must end in java To compile a program > javac <filename>.java ... Intermediate code compiler javac Trang 36Byte code and JVM The javac command converts the source programs into byte code Byte code files are those with the extension .class The java command causes
Ngày tải lên: 24/03/2016, 22:03
Giáo trình Java cơ bản 04
... Trang 14Execution staring point in Java Java programs are a collection of classes Each class must be stored in a file with the same name, but also with the java extension A class may have ... main method specified to the interpreter: > java MyClass starts at the main method in the class MyClass Trang 15Execution staring point in Java us a place to start in the program driver ... algorithms to solve problems – How to convert algorithms into programs – How to edit, compile and run Java programs Trang 2► Elements of a program Trang 4Input and output – A way of receiving information
Ngày tải lên: 24/03/2016, 22:05
Giáo trình Java cơ bản 07
... an initial capital shoeSize – This convention is sometimes referred to as camelBack notation Java is case sensitive, therefore it distinguishes between uppercase and Trang 8Keywords Keywords ... floating-point Trang 12Integer data types positive and negative values) 4 types of integers in Java that store values in different amounts of memory range of values they can store specific ... Floating-point number types store numbers with fractional parts 2 types of floating-point numbers in Java that store values in different amounts of memory Not all numbers can be stored exactly using
Ngày tải lên: 24/03/2016, 22:07
Giáo trình Java cơ bản 08
... representation of integers Trang 48/4 Integer types Integers are whole numbers 0, -1, 1, -2, 2, etc Java has 4 integer types We most commonly use the int type Type name Memory used Size range Trang ... representation of real numbers Trang 11Type double Real numbers are numbers with a fractional part Java has two types of real numbers Scientific (floating-point) form 45678 = 4.5678 x 1040.0345 ... represent a single character (of almost any language) Examples 'a' '+' '3' Stored in 2 bytes Java uses Unicode scheme to represent characters Stored as an unsigned 16-bit integer Range
Ngày tải lên: 24/03/2016, 22:07
Giáo trình Java cơ bản 10
... Trang 11► Scanner class Trang 1210/12 Scanner class in this subject It is a new addition to the Java language in order to simplify using keyboard input can read in or check the different types ... class, we first have to tell the compiler where to look for it with the import command import java.util.*; Then, declare and instantiate a Scanner object Scanner keyboard = new Scanner(System.in); ... number of seconds is: 11556 Enter the number of hours: 3.2 Exception in thread "main" java.util.InputMismatchException * Notice that hours is of type integer in the program code, however
Ngày tải lên: 24/03/2016, 22:09
Giáo trình Java cơ bản 11
... Trang 3► The if statement Trang 4if statement The Java if statement allows us to conditionally execute a statement The condition in brackets is ... in the if statement, it is good style to enclose it in braces if (time < 1400) { Trang 9Java Solution // get n1 and n2 Trang 10Example Problem – Read two numbers, then display the smaller ... specified values? E.g Check x is greater than 1 but less than 10 1 < x < 10 is not allowable in Java (1 < x) && (x < 10) is the solution Trang 24► Logical operators Trang 25Logical
Ngày tải lên: 24/03/2016, 22:09
Giáo trình Java cơ bản 16
... 10% per year (compounded yearly) – How long will it take for the balance to double itself? Trang 5Java solution double initialBalance = 1000; final double RATE = 0.10; double targetBalance = 2 ... stars Trang 37Example - addition table Write a program to display the addition table Trang 39Java Solution Trang 40Class exercise Write a loop structure to find all the prime numbers up
Ngày tải lên: 24/03/2016, 22:12
Giáo trình Java cơ bản 17
... true or false They are most often used in if, while and do…while Trang 6Boolean operator and Java && operator Truth table for && Trang 8Boolean operator not Trang 9Exclusive ... the other is true For example – The train is on Track 1 or Track 2 There is no operator in Java for this exclusive form of or, but we can write an expression with that meaning using && ... && ((limit/count) > 7) (limit < 20) && ((limit/count) > 7) Trang 17Evaluation Java uses short-circuit evaluation If the first part of an || is true, the second part of the
Ngày tải lên: 24/03/2016, 22:13
Giáo trình Java cơ bản 18
... to be called Trang 5318/53 Java files and separate compilation Each Java class needs to be in a separate file which has the same name as the class but with a java extension A class can ... Classes grouped and considered together describe and generate objects Trang 1018/10 Elements of a Java class Trang 1118/11 Abstractions programming) are abstractions – Simplified versions / representations ... them Trang 3318/33 Invoking a method To invoke a method in an object, we send it a message In Java, we specify the name of the object to receive the message and specify which of that object’s
Ngày tải lên: 24/03/2016, 22:14
Giáo trình Java cơ bản 20
... public String toString( ) Trang 33javadoc You can run javadoc on a single class or a whole package (explained later) On a single class javadoc MyClass.java Creates a file MyClass.html ... Java class libraries javadoc – program that extracts comments out of Java source files and creates an HTML file with the class interface information Trang 3020/30 javadoc See Appendix ... 2820/28 ► Javadoc (to generate documentation on classes) Trang 29Terminology API – Application Programming Interface – Specifies the interface of a Java class – Used to refer to the Java class
Ngày tải lên: 24/03/2016, 22:15
Giáo trình Java cơ bản 22
... this.<method> Trang 6Omitting this When we are referring to an attribute or method in the same object, Java lets us leave out the this object by <attribute> when there is no ambiguity (i.e name ... constants final public final static double PI = 3.14159; Trang 38The Math class In package java.lang – A package is a collection of classes functions public final static double PI
Ngày tải lên: 24/03/2016, 22:19
Giáo trình Java cơ bản 24
... the int value into double Trang 28} What is output? Trang 30Example The example shows that Java uses an overloaded method before trying to do automatic type conversion Trang 31Class exercise ... doubles This is referred to as automatic type conversion Trang 34Automatic type conversion Java uses an overloaded method before trying to do automatic type conversion Trang 35Class exercise
Ngày tải lên: 24/03/2016, 22:20
Giáo trình Java cơ bản 25
... general.utilities At the top of the DigitalClock.java file, I would have to place the package statement – package general.utilities; The directory myjavalibraries would have to be added to the ... environment variable so that Java would know to look for packages there Trang 50Packages Change your CLASSPATH variable in your .cshrc file setenv CLASSPATH ~myUserName/myjavalibraries: Separate ... import statement tells the compiler where to find the classes in the package To find a package Java needs – The name of the package – The classpath variable Trang 48Package names The package
Ngày tải lên: 24/03/2016, 22:21
Giáo trình Java cơ bản 27
... ++i) Trang 25Arguments to main >java CommandLineTester args contains 0 strings >java CommandLineTester Fred args contains 1 strings Argument 1 is Fred >java CommandLineTester Fred Nerk ... readArray(arraySize); displayHorizontalBarChart(number); } Example Trang 23Arguments to main When a Java program starts, it is possible to pass in values to be used in the main method Every time ... >java CommandLineTester Fred Nerk args contains 2 strings Argument 1 is Fred Argument 2 is Nerk >java CommandLineTester Fred Nerk Age 23 args contains 4 strings Argument 1 is Fred Argument 2 is
Ngày tải lên: 24/03/2016, 22:23
Giáo trình Java cơ bản 32
... applets Java has two kinds of launcher programs – Java applications: programs that are launched from the operating system’s console window (also known as stand-alone programs) – Java applets: ... of pixels Each pixel can be referred to individually by giving its coordinates Graphical Java applets use a coordinate system to place text and pictures in the applet window Trang 22Displaying
Ngày tải lên: 24/03/2016, 22:28
Giáo trình Java cơ bản 36
... The process of responding to events is known as event handling Trang 436/4 Java’s delegation approach Java’s approach to event handling is based on what is known as the delegation model ... quite different from the kind of programming that we have done so far We will first describe Java’s approach to driven programming, and then illustrate it with mouse events Trang 3event-Events ... listener The event listener is an instance of a class that implements a listener interface In Java, the term interface is also used to denote a collection of abstract methods to capture a set
Ngày tải lên: 24/03/2016, 22:32
Giáo trình Java cơ bản 37
... Trang 1Lecture 37 Covers – Traditional Java input Reading: Savitch Appendix 4 Trang 2Standard Java console input System.out is an object (an instance of the ... class, the problem is dealt with through Java’s exception handling mechanism Trang 7Exception handling When something unusual happens in a method, Java (or the method code itself) may signal ... part? We could search for the space characters or Trang 21StringTokenizer class In package java.util The StringTokenizer class allows us to separate a string into tokens Tokens are
Ngày tải lên: 24/03/2016, 22:33
Bạn có muốn tìm thêm với từ khóa: