Win a copy of TDD for a Shopping Website LiveProject this week in the Testing forum!

Rose

Greenhorn
+ Follow
since Sep 08, 2002
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Rose

As you know
with out "L" or "l" a decimal value is an Integer Literal.
So without "L" or "l" , "2222222222" is an Integer Literal.
The range for Integer is -2147483648 to +2147483647 .
"2222222222" is not in this range; That is why this Copile time
error.
If u try o assign a value in the above range there will be no
compile time error.The widening conversion happens with out any error.
Hope this help,
Rose

Hello,everyone.
I was stumbled at following qts:
Are these correct forms of inner class??
1. private final abstract class
2. new innerClass() implements someInterface
Thanks for you attention in advance.
Friends,
What is meant by 10 and 11?
Hello Herbert ,

As read all discusion I found that all are sure answer c is correct.
Where did you got this information?
I wish to know a little bit more about this .

Thanking u

Rose

Originally posted by Anand Iyer:
I tried..
char c=10;
System.out.println(c);
well.. the program compiled without error..
But when it printed out it was blank..
Why?Could anyone help me with this?
Thanks,
Anand


Hi Anand,
As you may know
char a=65;
System.out.println("Result = " + a);
gives you
Result = A
Means the charactor value corresponding to 65 is 'A' is printed.
If you code like this :
char c=10;
System.out.println(c);

The result will be the charactor value corresponding to 10 which "the new line character".
The new line charactor is the one which when tried to print works as '\n' in
System.out.println("This is for testing. \n Hello");

So your result will be "The current line is skipped ".

To make more clear : I tried this Code
public static void main(String args[]){
char a=65;
System.out.println("Result = " + a);
System.out.println("\nThis is for testing. \n Hello\n");
char ch=10;
System.out.println("This is for testing. "+ch+"Hello"+
" Java is cool"+ch+ " Yep You Got it");
}
The result was :
Result = A
This is for testing.
Hello

This is for testing.
Hello Java is cool
Yep You Got it

Originally posted by kevin_o:
1. As far as I know, the trim() method invoked on a String object will return a String object without the spaces. For e.g., invoking trim method on a String " h ey" will return "hey" without spaces in between.
2. Th method concat() returns a String that is concatenation of the two Strings. So invoking concat on "example" with an arg. String "s" would return a reference to a String object "examples"
3. Another thing is that when comparing two Strings, you may want to use equals() method. So comparing "whatup".equals("whatup") would return boolean true.


1. As far as I know, the trim() method invoked on a String object will return a String object without the spaces. For e.g., invoking trim method on a String " h ey" will return "hey" without spaces in between.

Is the result of this example is correct ?
when I tried I got "h ey".
Give me an explanation
Thanking you
Rose