You are on page 1of 5

Advanced Programming Using Java

Sub Code Total Hours : IS604 : 42 Credits : 3:0:1 Prerequisite: NIL

Unit-I
Overview of Java covering Inheritance, Packages, Interfaces and Exception Handling. java.util Part 1: The Collections Framework: Collections Overview, The Collection Interfaces, The Collection Classes: The ArrayList Class, LinkedList Class, HashSet Class. 8 hours

Unit-II
java.util Part 1: The Collections Framework: Accessing a Collection via Iterator, Storing User-Defined Classes in Collections, Working with Maps, Arrays, Why Generic Collections? SWING: The Java Foundation Classes, JFC Technologies, Swing features, Swing Components, Working with SWING, SWING basic containers, Buttons, Labels, Text Fields, Text Areas, Check Boxes. 9 hours

Unit-III
SWING: JApplet, Combo Box, Event Handling, Progress Bars. Introduction to Java Server Pages: JSP v/s Servlets, Life cycle of a JSP Page. Getting started with JSP: JSP Elements, A Sample JSP Page. Java Server Pages Document: Directives, Scripting Elements, A Sample JSP Document. . 9 hours

Unit-IV
Action elements of JSP: Including other files, forwarding JSP page to another page, passing parameters for other actions Working with Databases: JDBC, Advantages of JDBC, JDBC Architecture, Types of JDBC Drivers, how to access database, Using Databases, Connecting to Database, Performing Database Operations. 8 hours

Unit-V

Java Threads: What is multi-threading?, The Thread Control methods, The thread life cycle, The main Thread, Creating the thread, Extending the thread class. Remote Method Invocation: What is a distributed Operating System?, Distributed Object Technologies, RMI for Distributed Computing, RMI Architecture, RMI Registry Service, Creating RMI Applications, Steps involved in running the RMI Application incase the server application and the client application is run in the same machine, Removing Objects from a registry. 8 hours Text books 1. Herbert Schildt, The Complete Reference Java (J2SE 5 Edition), TATA McGRAW-HILL Edition 2005. 2. Ivan Bayross, Sharanam Shah, Cyntiha Bayross and Vishali Shah, Java EE 5 for Beginners, SPD (Sharoff Publishers & Distributors Pvt. Ltd.), 2nd edition August 2008. References 1. Jim Keogh, The Complete Reference J2EE, TATA McGRAW-HILL Edition 2002. 2. B V Kumar, S Sangeetha, S V Subrahmanya, J2EE Architecture, TATA McGRAW-HILL Edition 2007.

Advanced Programming Using Java Lab


1. Write a Java Program that does the following related to Inheritance: a. Create an abstract class called Vehicle which contains the year of manufacture and two abstract methods getData() and putData(). Demonstrate the error when attempt is made to create objects of Vehicle. b. Have two derived classes TwoWheeler and FourWheeler. FourWheeler is a final class. Demonstrate the error when attempt is made to inherit from FourWheeler. c. TwoWheeler has data elements Brand, Cost, EngineType (possible values 2 stroke, 4 stroke), and Color which are private, protected, friendly/default and public respectively. Demonstrate the various ways in which the two abstract methods can be dealt getData() and putData() can be dealt with by the derived classes, TwoWheeler and FourWheeler. d. The sub-class of TwoWheeler called MyTwoWheeler has the element Owner Name. e. Use the super keyword to initialize an object of MyTwoWheeler with all the values of its parent class data elements. 2. Write a Java Program that does the following related to Packages using source code created in Program 1. : a. Create a package called package1 which contains Vehicle and FourWheeler. b. Another package called package2 which contains TwoWheeler and MyTwoWheeler. c. Demonstrate the visibility of the access modifiers of the data members in a main program within package2. 3. Write a Java Program that does the following related to Interfaces, Packages, Inheritance and Exception Handling using source code created in Program 1and 2.: a. Create a package called package3 which should hold the interfaces FuelType, FuelConsumed and Fuel. b. Create an interface called FuelType which has a method to get the type of fuel (petrol/diesel). c. Create another interface called FuelConsumed which has a method to get the liters of fuel consumed. d. Make an interface called Fuel which inherits from both FuelType and FuelConsumed. It also has a method which gives the mileage per liter of fuel. e. Make package1.FourWheeler implement the interface Fuel. f. Make package2.TwoWheeler implement the interface FuelConsumed. g. Demonstrate how package2.MyTwoWheeler uses the interface FuelConsumed. h. Create user-defined exception called MyException which is invoked if the cost of the vehicle & the amount of fuel consumed is not entered as a number divisible by 10. i. Demonstrate the above aspects in a main program within package2. 4. a) Use at least three aspects of the Collections Framework and one Collection Algorithm to write a program which computes the frequency of words passed to it both as command line arguments and from STDIN. Also sort the list of words entered both in ascending and descending order. b) Store the details of the students in a user-defined class. Create a Generic Collections LinkedList of these student user-defined classes. Remove a specific student from the list by asking the choice from the user. Shuffle the list. Now display the first and last student details. 5. Write a Java Swing program which demonstrates the following functional aspects of Swing components. a. Swing JPanel or JFrame. b. Any Swing Basic Container (Root Pane, Content Pane, Glass Pane, Layered Pane)

c. Menu Bar and its associated actionPerformed Events. d. The Container has TextBox, TextArea, Buttons, CheckBox, Label and ComboBox. e. EXIT_ON_CLOSE event should be included 6. Write a program using JSP that helps a student to calculate the income tax on various annual incomes that he will be earning when he gets a job. Login.html will call dataCapture.jsp that should do the following: Use Java Collections to make a list of valid users and facilitate user login functionality Give a personalized Welcome message and display todays date Have a Text Entry with label Name to enter the name of the user Give a List of Organizations to choose Place of Work Provide a Male or Female option to choose the Gender Have a Text Entry with label Annual Income Give a Submit button reading Calculate Tax CalculateInterest.jsp must calculate the interest based on the following business rules: No income-tax on first 100,000 of salary. 10% tax on next 100,000 of remaining salary 20% on next 100,000 of remaining salary 30% on next 100,000 of remaining salary 100% on remaining salary. The investment of maximum 100,000 is considered as non-chargeable income. The final income tax along with the details of how it is calculated must be put in a session object and displayed to the user in dataCapture.jsp. All the income taxes calculated so far by the user, must be taken out of the session object and displayed, each time in dataCapture.jsp which has a link called Logout that destroys the session. Optional: Apply the concepts learnt in Internet Programming Lab (5 th Sem) and validate the user inputs using JavaScript and beautify/align the pages using CSS. 7. a) Write a program that uses Java Swing and JDBC to create a stand-alone application that helps the user create two tables, namely, Faculty(FacID, FacName) and Subjects(SubID, SubName, FacID). b) Use the Java Swing Components or JSP to insert values into these two tables. Display the values inserted. Allow the user to choose a particular faculty from a list and display the subjects allotted for that faculty.

8.

a) Write a Java Program that creates two threads. The first thread displays every 5 seconds the message Good Morning and a random Did U know fact from a predefined list of such facts. The second thread displays every 10 seconds the message Reminder and a random Do Not Forget tip from a pre-defined list of such tips. Use Java Collections to store the facts and tips. b) Create a RMI based client-server application. The remote method invoked must display the name of the animal and the sound it produces when it speaks. E.g. Dog says Woof. Optional: Implement the RMI Client and Server as two programs running on two different machines.

Continuous Internal Evaluation: 50 Marks Internal Assessment Tests: 25 Marks Three tests carrying 25 marks each will be conducted. The average of the best two will be considered as the final test marks. Other components: 10 Marks Surprise Tests/Class Assignments = 10 Marks Lab Components: 15 Marks ( 10 + 5 ) Continuous Internal Evaluation with Viva = 5 Marks Two lab tests (Mid Term and Final) will be conducted for 10 marks each. The average of both the tests will be taken to give a total of 10 Marks. Note: Program # 1 and #2 are practice programs and not included for the mid-term and final assessments, which therefore has programs from #3 to #8. Note: Lab Programs Beyond Curricula should not be included for the mid-term and final assessments.

TO BE KEPT IN COURSE FILE FOR ADVANCED PROGRAMMING & NOT INCLUDED IN SYLLABUS
Subject: Advanced Programming Using Java Subject Code: IS604 Semester: 6

Content Beyond Curriculum Lab Work


1. Write a Java Server and Client program that creates either a TCP or UDP Socket. The program must do the following: a. Display todays date b. Check which weekday it is c. If it is Monday display the message 6C U have CN Lab Today d. If it is Tuesday display the message 6A U have J2EE Lab Today e. If it is Wednesday display the message 6B U have J2EE Lab Today f. If it is Thursday display the message 6C U have SS Lab Today g. If it is Friday display the message Yeah! We all have our afternoon off. We can go for a movie released today! h. If it is Saturday display the message Whew! End of a hectic week. Glad its Sunday tomorrow! Optional: Implement the Java UDP/TCP Socket Client and Server as two programs running on two different machines. 2. Create a Java Web Application which uses EJB Session Beans to calculate the income tax on annual income using the following steps: a. Create a new enterprise application b. Create an appropriate JSP page for your application c. Create a java home interface which contains the calucateInterest() method d. Define the Session EJB and implement all the necessary methods along with calucateInterest(). e. The business logic for calucateInterest() is as given in Program #6 above. f. Create a servlet class that will be used to call the entity bean. g. Modify the web.xml file h. Deploy the project and run it on your web browser.

You might also like