ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
tip       Ask Questions on ANYTHING, that arise in your Daily Life at     FORUM9.COM
Google
 
 Categories  >>  Software  >>  Core Java  >>  Java J2EE  >>  Java Related       
Suggest New Category 
 


 

View Page with Answers
  Question  Asked @ Answers Views     select
 
what is Remote Reference Layer ?  1  213
What is file class and what is its purpose?  1  857
Explain Public static void main?  2  2338
Name two subclasses of the TextComponent class?  2  694
What are teh sub-classes of a component class?  2  691
What are the names of Component subclasses that support painting?  0  167
What primitive Java types? Howmany are they and what are their names?  3  786
What are the names of interfaces that doesn't consists of method/s ?  3  779
Can you give names of Container classes? Ordain-Solutions  0  187
What classes can be used to store arbitrary number of objects ?  1  270
Explain Connection Pooling?  3  694
Are there any tools available in java to create reports?  5  729
Does any tag exists in HTML to upload and download files ?  2  1081
Is 'sizeof' a keyword?  5  1397
Is 'null' a keyword?  3  1293
E-Mail New Answers        Answer Selected Questions        Post New Core Java Question
 
Prev    1   ... 7   ... 13   ... 19   ... 25   ... 31   ... 37   ... 43   ... 49   ... 55   ... 61    70   [71]    72  ... 79    Next
 
 
 Core Java interview questions   Core Java Interview Questions  Advanced Java interview questions   Advanced Java Interview Questions  Swing interview questions   Swing Interview Questions
 EJB interview questions   EJB Interview Questions  Servlets interview questions   Servlets Interview Questions  Struts interview questions   Struts Interview Questions
 JDBC interview questions   JDBC Interview Questions  JMS interview questions   JMS Interview Questions  SunOne interview questions   SunOne Interview Questions
 J2EE interview questions   J2EE Interview Questions  Weblogic interview questions   Weblogic Interview Questions  Websphere interview questions   Websphere Interview Questions
 Java Networking interview questions   Java Networking Interview Questions  Java J2EE AllOther interview questions   Java J2EE AllOther Interview Questions
 
 
 
Un-Answered Questions
 
 Question Views Asked at   Select
 
How to print nodes of a Binary tree? 210  
Java run-time system generates What class of exceptions? 133 TCS
What are the differences between Java 1.0 and Java 2.0? 128  
Question 6 [9] 6.1 In what situations (in general) would you use a TreeMap? (3) 6.2 In what situations (in general) would you use a HashSet to store a collection of values? 24  
hi am an engineering student and my next plan is for ms in either in us or australia i got my passport but i dont know anything bout visa can u give brief idea 1)How to get prepared for visa and 2)How to apply for top universities and 3)How to pay the fee and so on These all are basic questions plz give me a clear idea 76  
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 priya_gupta@gmail.com 19 IBM
Name the components that are termed to be Heavy-weight component but available in Light-weight components? 371  
How to connect to a remote database using Applet? 227  
What is meant by Java ? 154 CMC
what is the use of pojo (plain old java objects)? how it is interact with crystal reports? pls urgent 119  
how to write a program for sending mails between client and server 99 Lampex
if u open login & logout ,how can udisplay the timelogin & logout members ? 80 Virtusa
What is stored procedure. How do you create stored procedure ? 71 GE
what is dafault constructor and paramererised constructor with example? 116  
What methods are used in Servlet?Applet communication? 291 Satyam
how to handle exceptions in ejb? 62 Satyam
How to know the host from which Applet is originated? 156  
What are the names of Component subclasses that support painting? 167  
What are the restrictions imposed by a Security Manager on Applets?. 172  
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) 21  
E-Mail New Answers        Answer Selected Questions
 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com