Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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

TCS Interview Questions
Questions Answers Views Company eMail

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)

2242

is there any criteria to get a job in hcl after MCA.

2 6080

which header file contains main() function in c?

17 30621

to write a number in words eg. FIVE requires 10 straight lines. what is the number which requires the same number of lines as that of the number itself

13 20634

WHAT IS THE SIGNIFICANCE OF VECTOR GROUPS IN TRANSFORMER? WHAT WILL BE EFFECT WHEN PHASE DISPLACEMENT CHANGES IN TRANSFORMER?WHAT IS THE NEED TO BE PHASE SHIFT CHANGE BETWEEN THE PRIMARY AND SECONDARY WINDING

1753

need question papers from 2007 to 2009

59 63942

Common UI for Multiple web applications. Suppose there are 35 websites using same third party controls.These 3rd party controls are made together that all 35 websites can use these controls.If we put all 3rd party controls and use its dll in 35 websites,only class files will be accessable. But I want to use CSS,images also in all 35 websites. how I can design the N-tier solution for this project.

2665

Can anyone explain me the operating principle of the megger tester?( I just know that its diflection relates with the ratio of currents of control & diflecting coil. I need more information as breif as possible)

1 4336

what will come in place of the question mark(?)in the following alphabet series? AC DC EF IG? 1)MI 2)IL 3) IM 4)LI 5)None of These plz ans hurry and with detail

4 15080

what is the diffrence between weblogic server 8.x/9.x/10.x?

7 36898

How to validate the entry in Screen & dialog proframming?? Is there any way to send the error??

2 6863

what is the z-transaction?? what's the use of it??

2 16130

what is the full form of bpl

15 34383

Perform addition, multiplication, subtraction of 2-D array using Operator Overloading.

3817

why should i hire you

10 20013

Post New TCS Interview Questions


TCS Interview Questions


Un-Answered Questions

How much quantity of cement Bag for block masonry (1:4) for 1 cu.m? Block size (150x200x400) Mortar Thickness 20mm

1456


Dear sirs, pls check this 4-20ma to RS485 module datasheet,pls guve me some suggestions. http://www.szsunyuan.com/sy/pro_more.asp?Productid=539 Thanks. E-mail:yunianjiang99@gmail.com

2059


Give notes on role of ISO in quality assurance.

1096


What is the wall thickness of NP-3&NP-4 hume pipe as per I.S code

2077


What are pages in wordpress?

157


Is indentation required in python?

814


Explain the use of containers in ssis and also their types?

925


As you are working with cmmi level 5 company ,can you tell me what processes you r following as QA engineer?

2449


How will you monitor replication latency in transactional replication? : sql server replication

1105


What is the state of inland fisheries?

2124


Explain transaction control transformation in informatica

1228


What is an oracle and why it is used?

1094


Can we create Hierarchies in generic datasources?

2341


How many aware interfaces are there?

868


What are eigenvalue and eigenvector?

322