Win a copy of Spring Boot in Practice this week in the Spring forum!

VINCE CARTER

Greenhorn
+ Follow
since Sep 26, 2004
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 VINCE CARTER


question:

Why we use this here ? Why not Test.bool ??


(Magical [C0DE][/C0DE] tags added - must have for passing SCJP!)
Thanks!!!
[ October 14, 2004: Message edited by: Barry Gaunt ]
What will happen when you attempt to compile and run the following code snippet?

String str1, str2;
HashMap map = new HashMap();
str1 = (String) map.put("Color", "White");
str2 = (String) map.put("Color", "Blue");
System.out.println("Color : " + str1 + " " + "Color : " + str2);

Why:It will print - Color : null Color : White ??

Thanks!!
Even number : 0
Odd number : 1
Even number : 2
Odd number : 3
Even number : 4
Odd number : 5
Even number : 6
Odd number : 7
Even number : 8
Odd number : 9

Thanks!!
What will happen when you attempt to compile and run the following code?
(Assume that the code is compiled and run with assertions enabled.)

1.public class AssertTest
2.{
3.public static void main(String args[])
4.{
5.for(int i=0;i <10;i++)
6.{
7.try
8.{
9.assert i%2==0 : i--;
10.System.out.println("Even number : " + i);
11.}
12.catch(AssertionError ae)
13.{
14.System.out.println("Odd number : " + ++i);
15.}
16.}
17.}
18.}
Answer:It will print odd and even numbers from 0 to 9 correctly (0 even and 1 odd).
Why ?
In 310-035 exam,how can I pass the exam ?
52% or 61% ??
Which of the following results in a negative value of a?
A:byte a = -1; a = (byte)(a >>> 5);
B:int a = -1; a = a >> 5;
C:int a = -1; a = a >>> 32;
D:int a = -1; a = a >>> 8;
The answer is A,B,C.
But why??
Thanks!!
Which of the following will not compile without error?
A:
boolean b1=true;
boolean b2=true;
System.out.println(b1|b2);
B:
boolean b1=true;
boolean b2=true;
System.out.println(b1||b2);
Why the result is B not A ??
Thanks!!!
int x=6;
System.out.println(~x+1);
The result is :-6

int x=-6;
System.out.println(~(x-1));
The result is :6

Thanks!!!
1. public interface Foo{
2. int k = 4;
3. }
Which three are equivalent to line 2? (Choose Three)
A. Final int k = 4;
B. Public int k = 4;
C. Static int k = 4;
D. Private int k = 4;
E. Abstract int k = 4;
F. Volatile int k = 4;
G. Transient int k = 4;
H. Protected int k = 4;
Answer: A, B, C
I think the answer should be :B,D,H
Right ??
1:
Which two create an InputStream and open file the �file.txt� for reading? (Choose Two)
A. InputStream in=new FileReader(�file.txt�);
B. InputStream in=new FileInputStream(�file.txt�);
C. InputStream in=new InputStreamFileReader (�file.txt�, �read�);
D. FileInputStream in=new FileReader(new File(�file.txt�));
E. FileInputStream in=new FileInputStream(new File(�file.txt�));
Answer: B, E
2:
Which two construct an OutputSream that appends to the file �file.txt�? (Choose Two)
A. OutputStream out=new FileOutputStream(�file.txt�);
B. OutputStream out=new FileOutputStream(�file.txt�, �append�);
C. FileOutputStream out=new FileOutputStream(�file.txt�, true);
D. FileOutputStream out=new FileOutputStream(new file(�file.txt�));
E. OutputStream out=new FileOutputStream(new File(�file.txt�)true);
Answer: C, E

Does the answers are right ?