:: 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
Suggest New Category 


Question Asked @ Answers Views     Select
What is the life-cycle of an object?    1  307
How is object created in java?    3  239
What is an object in Java and what are its benefits?    2  204
What is Difference between Serializable and Externalizable in Java serialization?    1  200
What is difference between compatible and incompatible changes in serialization?    1  155
What is deserialization and how do we do deserialization?    3  146
What is serialVersionUID and what is its need?    1  158
How do we make a class serialize?    3  156
Why do we need main method to execute a java program?    1  223
What is difference between overloading and overriding?    2  350
Describe OOP in java?    2  230
What are the uses of final, finally and finalize in java?    1  161
Are the equals() and hashCode() protected methods of object class?    1  149
How to override equals() and hashCode() method in java?    1  177
Why do we need to override equals() and hascode() method of object class?    1  169
E-Mail New Answers        Answer Selected Questions        Post New core-java Questions
 [1]    2  ... 10   ... 19   ... 28   ... 37   ... 46   ... 55   ... 64   ... 73   ... 82   ... 91   ... 100   ... 109   ... 118    Next
Un-Answered Questions
 Question Views   Select
what are the disadvantages of indexes in oracle? 658
we have syntax like for(int var : arrayName) this syntax is to find whether a number is in the array or not.but i want to know how to find that number's location. 494
which pattern is default in scanner package? 745
What collections you have worked on? Internal working of Hashmap? 632
java Technical questions asked by JPMC 3096
Addition to previous section relative word 5th one was Putrid ans: rotten, also there was prob. in 1st section on bucket weight ans:10kg, also there was a prob. on train speed to find bridge length ans:800 mtrs. 482
Name the components that are termed to be Heavy-weight component but available in Light-weight components? 962
I want to store more than 10 objects in a remote server? Which methodology will follow? 1381
What are invisible components?. 659
How to connect to a remote database using Applet? 976
how to deploy tomcatserver to weblogic server? write d following steps? 379
Question 5 [15] Consider the following classes, illustrating the Strategy design pattern: import java.awt.*; abstract class Text { protected TextApplet tA; protected Text(TextApplet tApplet) { tA = tApplet; } abstract public void draw(Graphics g); } class PlainText extends Text { protected PlainText(TextApplet tApplet) { super(tApplet); } public void draw(Graphics g) { g.setColor(tA.getColor()); g.setFont(new Font("Sans-serif", Font.PLAIN, 12)); g.drawString(tA.getText(), 20, 20); } } class CodeText extends Text { protected CodeText(TextApplet tApplet) { super(tApplet); } public void draw(Graphics g) { g.setColor(tA.getColor()); g.setFont(new Font("Monospaced", Font.PLAIN, 12)); g.drawString(tA.getText(), 20, 20); } } public class TextApplet extends java.applet.Applet { protected Text text; protected String textVal; protected Color color; public String getText() { return textVal; } public Color getColor() { return color; } public void init() { textVal = getParameter("text"); String textStyle = getParameter("style"); String textColor = getParameter("color"); if (textStyle == "code") text = new CodeText(this); else text = new PlainText(this); if (textColor == "red") color = Color.RED; else if (textColor == "blue") color = Color.BLUE; else color = Color.BLACK; } public void paint(Graphics g) { text.draw(g); 10 } } The Text class is more complicated than it should be (there is too much coupling between the Text and TextApplet classes). By getting rid of the reference to a TextApplet object in the Text class and setting the colour in the paint() method, one could turn the Text class into an interface and simplify the strategy classes considerably. 5.1 Rewrite the Text and PlainText classes to do what is described above. (6) 5.2 Explain the consequent changes that are necessary to the TextApplet class. (4) 5.3 Write an additional strategy class called FancyText (to go with your simplified strategy classes) to allow fancy text to be displayed for the value "fancy" provided for the style parameter. It should use the font Font ("Serif", Font.ITALIC, 12). (3) 5.4 Explain what changes are necessary to the TextApplet class for this. (2) 452
Write a java program to find the route that connects between Red and Green Cells. General Rules for traversal 1. You can traverse from one cell to another vertically, horizontally or diagonally. 2. You cannot traverse through Black cells. 3. There should be only one Red and Green cell and at least one of each should be present. Otherwise the array is invalid. 4. You cannot revisit a cell that you have already traversed. 5. The maze need not be in the same as given in the above example 947
which is advanced deep technology in java launched by the sun microsystem??? The answer is very logical If u need correct answer mail me at 459
Write down program for following scenario. Use java coding standard. You have array list with some words in it..we will call it as dictionary….and you have a arbitrary string containing some chars in it. You have to go through each word of dictionary and find out if that word can be constructed with the help of chars from arbitrary string given. If you find the word print it else print none. 1041
E-Mail New Answers        Answer Selected Questions