Solved

java programming

Posted on 2004-09-30
24
209 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
 
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
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 
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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Suggested Solutions

Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
This video teaches viewers about errors in exception handling.

707 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now