Company Name Starts with ...
#  A  B  C  D  E   F  G  H  I  J   K  L  M  N  O   P  Q  R  S  T   U  V  W  X  Y  Z

FCUK General Knowledge_Current Affairs Interview Questions
Questions Answers Views Company eMail

The largest wheat-producing Indian state is: (A) UP (B) MP (C) Punjab (D) Haryana

26 54723

Post New FCUK General Knowledge_Current Affairs Interview Questions


FCUK General Knowledge_Current Affairs Interview Questions


Un-Answered Questions

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)

1822


How to pass data to a program that is coded in an exec statement?

815


How would you define a protected member in a python class ?

447


What relevant domain experience does the team have? - Venture Capitalists

1281


What is @manytoone fetch fetchtype lazy?

151






How many rejections do you take in a typical week?

2040


hiiiii Respected sir/madam gd morning sir/Madam Can you please give me following questions of answer.? 1) what is the main difference between Current Assests and Fixed Assests? 2) working capital Management? why? which steps requried for working capital management at the statring day of the any type of business? 3) Ratio analysis? why? (Note: 1,on the above questions of answer the following points are exculded) 1) object 2) theory 3) features (Note :2,on the aove questions of answer the follwing points are inculded) 1) Practical oriented 2) aspects of business please reply..................

1778


What are the 4 types of files we need to copy to the standard folder?

5


How do you copy formatting?

322


What is the concept of Association?

71


State the rules to be followed during infix to prefix conversions?

632


What is the output of TextWriterTraceListener redirected?

537


What is a sympy?

498


What is the diff between vb mdi form and .net mdi form?

539


What are different states of an entity bean in hybernate?

148