:: Home Page
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   Errors
   Testimonials Refer this Site  Refer This Site to Your Friends  Site Map  Contact Us      
 Categories >> Software >> Java Related >> Java J2EE
  Core Java (1806)   Advanced Java (347)   Swing (45)   EJB (134)   Servlets (256)
  Struts (198)   JDBC (188)   JMS (89)   SunOne (10)   J2EE (73)
  Weblogic (149)   Websphere (14)   Java Networking (20)   Java J2EE AllOther (86)
Suggest New Category 


Question Asked @ Answers Views     Select
What is the life-cycle of an object?    1  5
How is object created in java?    1  5
What is an object in Java and what are its benefits?    1  8
What is Difference between Serializable and Externalizable in Java serialization?    1  42
What is difference between compatible and incompatible changes in serialization?    1  40
What is deserialization and how do we do deserialization?    3  33
What is serialVersionUID and what is its need?    1  32
How do we make a class serialize?    3  40
Why do we need main method to execute a java program?    1  102
What is difference between overloading and overriding?    2  111
Describe OOP in java?    2  88
What are the uses of final, finally and finalize in java?    1  59
Are the equals() and hashCode() protected methods of object class?    1  47
How to override equals() and hashCode() method in java?    1  47
Why do we need to override equals() and hascode() method of object class?    1  39
E-Mail New Answers        Answer Selected Questions       
 [1]    2  ... 17   ... 33   ... 49   ... 65   ... 81   ... 97   ... 113   ... 129   ... 145   ... 161   ... 177   ... 193   ... 209   ... 225    Next
Un-Answered Questions
 Question Views   Select
What is Client-Server Computing? 741
you are to choose between two procedures,both of which copute the minimum value in an array of procedure returns the smallest integer if its array argument is empty. the other requires a nonempty array.which procedure should you choose and why? 1128
please send me hr interview questions in it industry 491
What is colon_pkg_prefixes and what is its use? 932
Name the class that is used to bind the server object with RMI Registry? 659
what is dafault constructor and paramererised constructor with example? 582
why Bean class implements all business method of Remote interface but bean bean class not implements the remote interface 844
which pattern is default in scanner package? 734
What are advantages of using Java?s layout managers than windowing systems? 822
4.1 Supply contracts (in the form of comments specifying pre- and post conditions) for the enqueue() method of the LinkedQueue class given in the Appendix. (2) 4.2 Let Thing be a class which is capable of cloning objects, and consider the code fragment: Thing thing1 = new Thing(); //(1) Thing thing2 = thing1; //(2) Thing thing3 = (Thing) thing1.clone(); //(3) Explain how the objects thing2 and thing3 differ from each other after execution of the statements. ( 365
3.2 Consider the following class: public class Point { protected int x, y; public Point(int xx, int yy) { x = xx; y = yy; } public Point() { this(0, 0); } public int getx() { return x; } public int gety() { return y; } public String toString() { return "("+x+", "+y+")"; } } Say you wanted to define a rectangle class that stored its top left corner and its height and width as fields. 3.2.1 Why would it be wrong to make Rectangle inherit from Point (where in fact it would inherit the x and y coordinates for its top left corner and you could just add the height and width as additional fields)? (1) 8 Now consider the following skeleton of the Rectangle class: public class Rectangle { private Point topLeft; private int height, width; public Rectangle(Point tl, int h, int w) { topLeft = tl; height = h; width = w; } public Rectangle() { this(new Point(), 0, 0); } // methods come here } 3.2.2 Explain the no-argument constructor of the Rectangle class given above. 3.2.3 Write methods for the Rectangle class to do the following: • a toString() method that returns a string of the format "top left = (x, y); height = h; width = w " where x, y, h and w are the appropriate integer values. • an above() method that tests whether one rectangle is completely above another (i.e. all y values of the one rectangle are greater than all y values of the other). For example, with the following declarations Rectangle r1 = new Rectangle(); Rectangle r2 = new Rectangle(new Point(2,2), 1, 4); the expression r2.above(r1) should give true, and r2.above (r2) should give false. (You can assume that the height of a rectangle is never negative.) (2) (5) 433
Can you give names of Container classes? 800
Why does java doesnt suuport unsigned values? 650
Say you want to store the information about a number of pets in an array. Typical information that you could store for each pet (where relevant) would be • Breed of animal • Animal's name • Its birth date • Its sex • Whether it has been sterilised or not • When it is due for its next inoculation • When it last had its wings clipped For each type of pet (eg. dog, cat or bird) you would typically define a class to hold the relevant data. Note: You do not need to implement these classes. Just answer the following questions. 3.1.1 What would be the advantage of creating a superclass (eg. Pet) and declaring an array of Pet objects over simply using an array of Objects, storing each of the instances of the different pet classes (eg. Dog, Cat or Bird) in it? 3.1.2 Would you define Pet as a class or as an interface? Why? (2) (2) 332
What is the main functionality of the remote reference layer? 282
E-Mail New Answers        Answer Selected Questions