Originally posted by Marcus Jastrebowski:
Thanks R, and so, after a little bit of fiddling around, I was able to satisfy this requirement: "In reverse(), check if the String has a length of 0 by using String.length() method. If the length is 0, the reverse() method will throw exception." The code gets considerably longer that way, but I guess the idea of this particular exercise was to show how the exceptions are propagated up the stack from one method to another.
Here is the reworked version, and it seems to be working fine now.
Originally posted by ishmayel vemuru:
Hi I had Little bit confusion..If you don't mind can any one explain please.
Boolean b1 = true;
boolean b2 = false;
boolean b3 = true;
why this if((b1 = false) | (b1 & b3) | (b1 | b2)) is returning the false....I am thinking this will return true..like this
b1 = false) | (b1 & b3) | (b1 | b2)
------------|-----------| ---------
false | true | false
------------------------|------
true |false = true
but when test this this is returning the false
If there is any wrong in my evaluation...Please any one explain.
Thanks in advance.
Originally posted by ishmayel vemuru:
class Feline
{
public static void main(String[] args)
{
Long x = 42L;
Long y = 44L;
System.out.print(" " + 7 + 2 + " "); // line---1
System.out.print(foo() + x + 5 + " "); //line--2
System.out.println(x + y + foo()); //line--3
}
static String foo() { return "foo"; }
}
Out Put:
72 foo425 86foo
Can any one explain the Concatination operator " + " at line 1, line 2 performing as a string concatination but at line 3 that is performing as addition operator...I'm confusing with this Please help me any one as early as possible.
Thanks in advance...
Ishmayel.
Originally posted by Nabila Mohammad:
I got the "==" part
How about the equals() part..?
Originally posted by R van Vliet: