hi friends do this

S

sudhir.ku

"Make an Exception class (InvalidInputException) such that
1)Anyone can set the message explicitly.
2)With every message, there should be a text like ""[Name of class]""
This Exception will be thrown if user enters the age below 1 or above
155
Make another class to use this exception
Test this Class and observe the output. "
 
D

Deniz Dogan

"Make an Exception class (InvalidInputException) such that
1)Anyone can set the message explicitly.
2)With every message, there should be a text like ""[Name of class]""
This Exception will be thrown if user enters the age below 1 or above
155
Make another class to use this exception
Test this Class and observe the output. "

No.
 
C

Chris Brat

throw new com.lang.java.programmer.LazyException("Do your own homework
!!");
 
E

Ed

(e-mail address removed) skrev:
"Make an Exception class (InvalidInputException) such that
1)Anyone can set the message explicitly.
2)With every message, there should be a text like ""[Name of class]""
This Exception will be thrown if user enters the age below 1 or above
155
Make another class to use this exception
Test this Class and observe the output. "

Done.

..ed
 
M

Michael Rauscher

Chris said:
throw new com.lang.java.programmer.LazyException("Do your own homework
!!");
Please provide a pointer to this library :)

Bye
Michael
 
Z

z-man

"Make an Exception class (InvalidInputException) such that
1)Anyone can set the message explicitly.
2)With every message, there should be a text like ""[Name of class]""
This Exception will be thrown if user enters the age below 1 or above
155
Make another class to use this exception
Test this Class and observe the output. "

public class LazyBoy
{
String thought = "Let me find a sucker that'll do my homeworks!";

public LazyBoy(){}
}

....
LazyBoy boy = new LazyBoy("(e-mail address removed)");
 
T

TechBookReport

z-man said:
"Make an Exception class (InvalidInputException) such that
1)Anyone can set the message explicitly.
2)With every message, there should be a text like ""[Name of class]""
This Exception will be thrown if user enters the age below 1 or above
155
Make another class to use this exception
Test this Class and observe the output. "

public class LazyBoy
{
String thought = "Let me find a sucker that'll do my homeworks!";

public LazyBoy(){}
}

...
LazyBoy boy = new LazyBoy("(e-mail address removed)");

Having looked at all the responses so far, I feel the need to refactor
your code slightly:

try {
LazyBoy sudhir=new LazyBoy("(e-mail address removed)");
} catch(NoSuckerException nse){
System.out.println("Failed miserably!!");
}
 
Z

z-man

z-man said:
"Make an Exception class (InvalidInputException) such that
1)Anyone can set the message explicitly.
2)With every message, there should be a text like ""[Name of class]""
This Exception will be thrown if user enters the age below 1 or above
155
Make another class to use this exception
Test this Class and observe the output. "

public class LazyBoy
{
String thought = "Let me find a sucker that'll do my homeworks!";

public LazyBoy(){}
}

...
LazyBoy boy = new LazyBoy("(e-mail address removed)");

Having looked at all the responses so far, I feel the need to refactor
your code slightly:

try {
LazyBoy sudhir=new LazyBoy("(e-mail address removed)");
} catch(NoSuckerException nse){
System.out.println("Failed miserably!!");
}

Nice fix, indeed! ;-)
 
M

man4*.*

hello...
as a beginer in Java I've got a few workbooks for practice, so
here's one example.
-how to exchange content of 2 int variables x and y using only those 2
variables without using
any functions and any other variable?
temp=x;
x=y;
y=temp;
this would be easier...but they have to complicate.... :)
 
C

Christopher Benson-Manica

TechBookReport said:
try {
LazyBoy sudhir=new LazyBoy("(e-mail address removed)");
} catch(NoSuckerException nse){
System.out.println("Failed miserably!!");
Job job = new Job("Burger King or whatever they have in Bangalore");
job.work( Time.FOREVER );

At least that's one fewer person to outsource American tech jobs to.
 
T

Tris Orendorff

Job job = new Job("Burger King or whatever they have in Bangalore");
job.work( Time.FOREVER );

At least that's one fewer person to outsource American tech jobs to.

Based on the quality of code coming out of India, I think it is safe to say Sudhir is over
qualified for the job.

--
Sincerely,

Tris Orendorff
[Q: What kind of modem did Jimi Hendrix use?
A: A purple Hayes.]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,266
Messages
2,571,082
Members
48,773
Latest member
Kaybee

Latest Threads

Top