Bài tập lập trình java cơ bản (Phần 1)

Java là một ngôn ngữ lập trình và nền tảng máy tính được phát hành lần đầu tiên bởi Sun Microsystems vào năm 1995. Nó đã phát triển từ những khởi đầu khiêm tốn để cung cấp sức mạnh cho một phần lớn thế giới kỹ thuật số ngày nay, bằng cách cung cấp nền tảng đáng tin cậy mà trên đó nhiều dịch vụ và ứng dụng được xây dựng. Các sản phẩm mới, sáng tạo và các dịch vụ kỹ thuật số được thiết kế cho tương lai cũng tiếp tục dựa trên Java.

Có nhiều ứng dụng và thậm chí một số trang web sẽ không hoạt động trừ khi bạn đã cài đặt Java. Java.com, trang web này, dành cho những người tiêu dùng yêu cầu Java cho các ứng dụng máy tính để bàn của họ - đặc biệt là các ứng dụng nhắm mục tiêu đến Java 8. Các nhà phát triển cũng như người dùng muốn học lập trình Java nên truy cập trang web dev.java và người dùng doanh nghiệp nên truy cập oracle.com/java để biết thêm thông tin.

  1. Cài đặt môi trường lập trình Java trên Windows, Ubuntu, Mac
  2. Cài đặt Eclipse, Netbean và Intellij Community trên Windows, Ubuntu, Mac
  3. Tạo project Java với Eclipse, Netbean và Intellij Community
  4. Phím tắt Netbean
  5. Phím tắt Eclipse
  6. Phím tắt Intellij Community
  7. Một số lỗi trong lập trình Java:
    • Error: cannot find symbol
    • Error: variable a might not have been initialized
    • Error: missing return statement
    • Error: incompatible types:…
    • Error: Could not find or load main class
    • Error: NullPointerException
    • Error: java.lang.ClassCastException
    • Error: is not abstract and does not override abstract method...
    • Error: non-static method... cannot be referenced from a static context
    • Error: Non-Static Variable ... Cannot Be Referenced From a Static Context
    • Error: modifier private not allowed here
    • Error: can not find symbol
    • Error: invalid method declaration, return type required
    • Error: possible loss of precision
    • Error: Method <X> in Class <Y> Cannot Be Applied to Given Types
    • Error: invalid method declaration; return type required
    • Error: public class ABC should be in file
    • Error: illegal start of an expression
    • Error: unclosed string literal
    • Error: … expected
    • Error: Reached End of File While Parsing
    • Error: Unreachable Statement
    • Error: Variable <X> Might Not Have Been Initialized
    • Error: Operator ... Cannot be Applied to <X>
    • Error: Inconvertible Types
    • Error: Cannot Return a Value From Method Whose Result Type Is Void
    • Error: (array) <X> Not Initialized
    • Error: ArrayIndexOutOfBoundsException
    • Error: StringIndexOutOfBoundsException
    • Error: NoClassDefFoundError
    • Error: NoSuchMethodFoundError
    • Error: NoSuchProviderException
    • Error: AccessControlException
    • Error: ArrayStoreException
    • Error: Bad Magic Number
    • Error: Broken Pipe
    • Error: Could Not Create Java Virtual Machine
    • Error: class file contains wrong class
    • Error: ClassCastException
    • Error: ClassFormatError
    • Error: ClassNotFoundException
    • Error: ExceptionInInitializerError
    • Error: IllegalBlockSizeException
    • Error: BadPaddingException
    • Error: IncompatibleClassChangeError
    • Error: FileNotFoundException
    • Error: EOFException
    • Error: UnsupportedEncodingException
    • Error: SocketException
    • Error: SSLException
    • Error: MissingResourceException
    • Error: NoInitialContextException
    • Error: NoSuchElementException
    • Error: NoSuchFieldError
    • Error: NumberFormatException
    • Error: TimeoutException