Solved

java programming

Posted on 2004-09-30
24
212 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 250 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
Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

 
LVL 4

Assisted Solution

by:gdrnec
gdrnec earned 250 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
 
LVL 92

Expert Comment

by:objects
ID: 12198188
0
 
LVL 92

Expert Comment

by:objects
ID: 12198194
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

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
firstswap challenge 20 77
map related example 6 48
use lov values 2 50
jsp insert to database example 2 24
After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.

777 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