The Artima Developer Community
Sponsored Link

Java Answers Forum
Java

1 reply on 1 page. Most recent reply: Jun 17, 2007 9:16 PM by Rajeev Mutalik

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 1 reply on 1 page
richa dhingra

Posts: 17
Nickname: quest123
Registered: May, 2007

Java Posted: Jun 14, 2007 6:26 AM
Reply to this message Reply
Advertisement
I want to know about Java Programming. Can any one explain me these two questions. Please explain me in detail. 1.Write a program which removes multiple spaces from a paragraph and must care for the general English conventions for writing a paragraph like (Sentence case, one space after full stop).
2. Using the array of classes (and subclasses) or single class variables you have created for your earlier assignments, implement a program which demonstrates polymorphism. In order to do this you will need to create an array or single variable of the superclass type and assign to it objects of both the superclass and one or more subclasses derived from the superclass. You then have to demonstrate the workings of polymorphism by calling a method in the subclass using the variable of the superclass type. If any one can solve this Please reply me soon as possible for you. Thanks.


Rajeev Mutalik

Posts: 57
Nickname: rajmutalik
Registered: Sep, 2002

Re: Java Posted: Jun 17, 2007 9:16 PM
Reply to this message Reply
1. It means whenever u are parsing a statement u shud ensuer that every new sentence starts with an uppercase letter and there is one space after the period (.).

For example:
Correct one: This is a test statement. It has to be parsed in my java program. But I am not sure how to do it.

Incorrect one: This is a test statement. It has to be parsed in my java program.but I am not sure how to do it.

In the incorrect one u can see that "b" is lowercase in the word "but" wherein it shud have been uppercase as it is start of new sentence. This is sentence case.
And also there are multiple spaces 'sure' and 'how'. This is multiple spaces mistake in a statement which u shud be removing and having only one space betn two words.
Also u can see that there is no spce betn period(.) and 'but' which is again incorrect. There shud be a space betn period and the next word.

2. For this u need to have a program or class in place. If you can write the initial code, then someone in this forum can help u with the mistakes, but the entire code cannot be written and given. Spoon feeding is a bad habit :).

Regards,
Rajeev

Flat View: This topic has 1 reply on 1 page
Topic: Java Previous Topic   Next Topic Topic: when

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use