Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

java programming

Posted on 2004-09-30
24
Medium Priority
?
224 Views
Last Modified: 2010-03-31
prompt the user to enter a fully qualified class name
If the class name they entered ends in ".class" strip that part off

I've tried my self to write code for the above requirement,am getting errors,could u pls help me?
0
Comment
Question by:sraveend
  • 8
  • 5
  • 4
  • +3
24 Comments
 
LVL 37

Expert Comment

by:zzynx
ID: 12193667
>> I've tried my self to write code for the above requirement,am getting errors,could u pls help me?
Yes, we could. If you show us what code you have and what errors.
0
 
LVL 37

Accepted Solution

by:
zzynx earned 1000 total points
ID: 12193681
The functions
   - String.endsWith()
   - String.substring()
will be useful
0
 
LVL 37

Expert Comment

by:zzynx
ID: 12193741
Here at EE we're not allowed to write (homework?) code for you.
Only to help you with problems that occur in your own code.
So...
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 4

Assisted Solution

by:gdrnec
gdrnec earned 1000 total points
ID: 12193767
String fqcName = // user entered class name
int index = fqcName.indexOf(".class");
if (index !- -1) fqcName = fqcName.substring(0, index);

Is that what you need?
0
 
LVL 4

Expert Comment

by:gdrnec
ID: 12193774
Oooops. Didn't think about the homework thing. If this is homework, shame on both of us.

My appologies.

Geoff
0
 
LVL 37

Expert Comment

by:zzynx
ID: 12193815
>> If this is homework, shame on both of us.
*Both* of us? You mean yourself and the author, I hope.

btw. even shorter:    

     String fqcName = // user entered class name
     String fqcWithoutClass = fqcName.replaceAll(".class", "");

;°)
0
 
LVL 4

Expert Comment

by:gdrnec
ID: 12193866
Quite.

;)
0
 
LVL 14

Expert Comment

by:sudhakar_koundinya
ID: 12194286
>>  Oooops. Didn't think about the homework thing. If this is homework, shame on both of us.

YOU DID THE RIGHT THING. YOU ARE NOT GIVING THE ENTIRE CODE.
0
 
LVL 14

Expert Comment

by:sudhakar_koundinya
ID: 12197678
strange, zzynx have already given the idea to you.
0
 
LVL 14

Expert Comment

by:sudhakar_koundinya
ID: 12197695
you could have split the points to both guys

Regards
Sudhakar
0
 
LVL 14

Expert Comment

by:sudhakar_koundinya
ID: 12197701
and also you have accepted wrong comment .
0
 

Author Comment

by:sraveend
ID: 12200020
Iam extremely sorry for using homework question!

0
 

Author Comment

by:sraveend
ID: 12200032
Hereafter i'll ask quetions with codings,Thanks a lot!
0
 
LVL 37

Expert Comment

by:zzynx
ID: 12200062
Thanks for ignoring me once again!
0
 
LVL 4

Expert Comment

by:gdrnec
ID: 12200096
Hey zzynx,

Did I get all these points in error. I wouldn't want to alienate. Is there any way to share?

Geoff
0
 
LVL 37

Expert Comment

by:zzynx
ID: 12200140
Hi Geoff,
thanks for your honesty.
I already asked Venabilli to reopen it *once again*.
0
 
LVL 4

Expert Comment

by:gdrnec
ID: 12200428
Not being obtuse here but I don;t see a split points link.

Geoff
0
 
LVL 37

Expert Comment

by:zzynx
ID: 12200480
Geoff, Venabilli's comment is meant for sraveend  (made a name mistake)
0
 
LVL 20

Expert Comment

by:Venabili
ID: 12201694
Yes. Sorry Geoff :(((

sraveend,

Any troubles?

Venabili
0
 
LVL 37

Expert Comment

by:zzynx
ID: 12206449
:)
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
In this post we will learn different types of Android Layout and some basics of an Android App.
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

972 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question