Monday, 23 November 2015

Java Lab@6

1.Write a program to display the number of objects created for a class.

.Ans




2.Take an existing application and refactor the code to implement the data access object (DAO) design pattern.

Ans. https://drive.google.com/open?id=0B-yL1mP3zqTbQUEyRml0a1g1cFE

3.Create an interface and implement that interface.

Ans.
        1 open the petcomposition project as the main project.
 a select file > open project.
 b browse t d:\labs\06-interfaces\practices.
 c select petcomposition and select the "open as main project chek box.
 d click the open project button.

2 expand the project diretories.

3 run the project. you should see output in the output window.

4 centralize all <name> functionality.
  a create a nameable interface (under the com.example package).
  b complete the nameable interface with setname and getname method signatures.
         public interface nameable {
       
         public void setname(string name);
   
        public string getname();
   }

c create a nameable class (under the com.example package).


4.Take an existing application and refactor it to make use of composition.

Ans.https://drive.google.com/open?id=0B-yL1mP3zqTbWDEtWHVtampPMms

5.Use the Hash-map collection to count a list of part numbers.

Ans.https://drive.google.com/open?id=0B-yL1mP3zqTbODlJOGQxNHBDWTQ



No comments:

Post a Comment