금요일, 1월 10
Shadow

#014 Java Polymorphism

미분류
Lab Exercises Exercise 1: Polymorphic behavior via method overriding (30 minutes) Exercise 2: Polymorphic behavior via abstract class (30 minutes) Exercise 3: Polymorphic behavior via Java interface (30 minutes) Homework Exercise (for people who are taking Sang Shin's "Java Programming online course")   Exercise 1: Polymorphic behavior via method overriding In this exercise, you are going build MyOnlineShop project first and then add ChildrenBook and Cartoon subclasses of the Book class. Build and run MyOnlineShop NetBeans project Add ChildrenBook and Cartoon subclasses (1.1) Build and run MyOnlineShop NetBeans project The MyOnlineShop project  is the same project that you have built and run as part of Java Inheritance hands-on lab.  Here we are go...

#013 Java Interface and Abstract Class

미분류
Lab Exercises Exercise 1: Abstract class (30 minutes) Exercise 2: Interface as a Type (30 minutes) Exercise 3: Implementing multiple interfaces (30 minutes) Exercise 4: Interface and polymorphism (20 minutes) Exercise 5: Inheritance among interfaces (30 minutes) Exercise 6: Rewriting an interface (20 minutes) Homework Exercise (for people who are taking Sang Shin's "Java Programming online course")   Exercise 1: Abstract class In this exercise, you will write Java program that use abstract classes.  You will also learn how to add polymorphic behavior to the program through abstact methods. Build and run an application that uses an Abstract class Build MyOnlineShopUsingAbstractClass project (1.1) Build and run an application that uses an Abstract...

#012 Java Inheritance

미분류
  Lab Exercises Exercise 1: Build and run a Java program which uses classes that are related through Inheritance (30 minutes) Exercise 2: Constructor calling chain and super keyword (30 minutes) Exercise 3: Overloading (30 minutes) Exercise 4: Type casting (30 minutes) Exercise 5: Final class and final method (20 minutes) Exercise 6: Build an application (30 minutes) Homework Exercise (for people who are taking Sang Shin's "Java Programming online course")   Exercise 1: Build and run a Java program which uses classes that are related through Inheritance In this exercise, you are going to write a program in which multiple classes, which are related with inheritance, are created and used.  First, you will create Person class.  Then you will create sub-classes ...

#010 Create Your Own Java Classes

미분류
Lab Exercises Exercise 1: Create an object instance of a class using "new" keyword (30 minutes) Exercise 2: Static variables and static methods (30 minutes) Exercise 3: Overloading (20 minutes) Exercise 4: Constructors (20 minutes) Exercise 5: "this" reference (20 minutes) Exercise 6: Access modifiers (20 minutes) Homework Exercise (for people who are taking Sang Shin's "Java Programming online course")   Exercise 1: Create your own class So far, you have dealt with a single class that contains main(..) method.  In this exercise, you are going to create multiple classes among which one class invokes another class - more precisely, a method in a class invokes a method of another class. Build and run an application that uses newly created StudentRecord class...

#009 Tour of java.lang.* and java.util.* classes

미분류
Lab Exercises Exercise 1: Boolean class, Various data types, Date class, Math class (20 minutes) Exercise 2: System properties (20 minutes) Exercise 3: System class (20 minutes) Exercise 4: Runtime class (20 minutes)   Exercise 1: Boolean class, Various data types, Date class, Math class In this exercise, you are going to use various classes. Boolean class Various data types Date class Math class (1.1) BooleanWrapper 1. Create a new NetBeans project Select File->New Project (Ctrl+Shift+N). The New Project dialog box appears. Under Choose Project pane, select General under Categories and Java Application under Projects.  Click Next. Under Name and Location pane, for the Project Name field, type in BooleanWrapper as project name. For C...

#008 Using Built-in Java Classes

미분류
Lab Exercises Exercise 1: Create an object instance of a built-in class using "new" keyword (20 minutes) Exercise 2: Static method and instance (non-static) method (20 minutes) Exercise 3: Pass by value and pass by reference parameter passing (20 minutes) Exercise 4: Scope of variables (20 minutes) Exercise 5: Type casting of primitive types and Wrapper class (20 minutes) Exercise 6: Comparing objects (20 minutes) Exercise 7: getClass() method and InstanceOf Operator (20 minutes) Homework Exercise (for people who are taking Sang Shin's "Java Programming online course")   Exercise 1: Create an object instance of a class using "new" keyword In this exercise, you will exercise the concept object instance creation using "new" keyword.  You will learn how you are g...

#007 Command-line arguments

미분류
  Lab Exercises Exercise 1: Read command-line arguments (20 minutes) Exercise 2: Read command-line arguments using NetBeans (10 minutes) Homework Exercise (for people who are taking Sang Shin's "Java Programming online course")   Exercise 1: Read command-line arguments Build and run Hello Java program that receives command-line arguments Read numbers as command-line arguments (1.1) Build and run Hello Java program that receives command-line arguments 1. Go to a directory where you want to create Java program C:\>cd \myjavaprograms 2. Write HelloCommandLineArguments.java using your editor of choice such as notepad on Windows platform or gedit on Solaris platform (in this example, I am using jedit) as shown in Code-1.10 below. C:\myjavaprograms&...

#006 Java Array

미분류
Lab Exercises Exercise 1: Build and run Java programs that use Java array of int (30 minutes) Exercise 2: Build and run Java programs that use Java array of String (30 minutes) Homework Exercise (for people who are taking Sang Shin's "Java Programming online course")   Exercise 1: Build and run Java programs that use Java array of int In this exercise, you are going to build  simple Java applications that use  array  of int. Build and run a Java program that uses single-dimensional array of int Build and run a Java program that uses two-dimensional array of int Build and run a Java program that computes the greatest number  (1.1) Build and run a Java program that uses single-demensional array of int 1. Create a NetBeans project Select File from top-lev...

#005 Java Controls

미분류
  Lab Exercises Exercise 1: if/else control structure (20 minutes) Exercise 2: for loop (20 minutes) Exercise 3: While loop (20 minutes) Homework Exercise (for people who are taking Sang Shin's "Java Programming online course")   Exercise 1: if/else control structure In this exercise,  you will learn how to write a Java program that uses if/else control structure. Build and run a Java program that uses if/else control structure Build and run 2nd Java program that uses if/else control structure (1.1) Build and run a Java program that uses if/else control structure 1.  Open MyGradesProject NetBeans project. Select File->Open Project (Ctrl+Shift+O). Observe Open Project dialog box appears. Browse down to <LAB_UNZIPPED_DIRECTO...

#004 Getting input from keyboard

미분류
Lab Exercises Exercise 1: Getting input from keyboard via BufferdReader (30 minutes) Exercise 2: Getting input from keyboard via JOptionPane (30 minutes) Homework Exercise (for people who are taking Sang Shin's "Java Programming online course")   Exercise 1: Getting input from keyboard via BufferedReader class In this exercise, you are going to build a simple interactive Java application, which gets user entered input data from keyboard. The program will use BufferedReader and InputStreamReader classes to receive the intput data. (You don't really need to understand in detail how these classes work, however.)  You will also learn how to use Javadoc to get more information on Java classes. Build and run GetInputFromKeyboard Java program Convert user entered Strin...