Antonio Trapero

+ Follow
since Mar 24, 2007
Merit badge: grant badges
For More
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Antonio Trapero

And boys, dont forget,
big farms need red tractors
\b \f \n \r \t
Thanks for all, guys. Without your help, i wouldn�t have done nothing.

Thanks to Kathy and Bert. Fantastic book.

And an advise for others, who are studying for this exam:
-first, Kathy and Bert�s SCJP book
-second, mock exams around web -much more difficult than exam.
-third, java ranch!

Good bye, and sorry for my english

-Next? SCWCD
17 years ago
if new String object is returned, it will print "Not Equal", cause both Strings are not in pool. On the other hand, if both replace calls were replace('G','g') , replace would not return new objects, and both would continue in pool. In this case, "Equal" would be printed.
If you dont throw any exception inside try/catch body , nor a call to a method that throws the exception, you have a compilation error. If you catch Throwable or error, it let you compile, cause errors could happen any time in runtime (you dont declare it).
v is final, cause of that, you must initialize it before contructor ends.
With import sentence, you will bring only one package at time or one class, not subpackages.

import java.util.*; only brings this package, no subpackages like regex.
import java.util.regex.*; only brings package regex.
import java.util.regex.Pattern; only brings Pattern class.
2 reasons:

-->First, it has to be abstract. Not implements public void run().
-->Second, look at call to addAmount(); the method is not define. Even class
was abstract , you will still have compilation error.

Oh, dude for me, in third person of conditional, is "class was", or "class were" sorry for my english
Yes but --->
char c = 3 compiles,
int a =3; char c =a no.

I think this is cause 3 its a compile time constant, and compiler feels happly and implicity put the cast.

If you do
final int i = 3;
char c = i;

this compiles fine.
Look variable index inside main. It iss shadowing instance variable inside main block. Cause it has not been initialized, you get a compilation error.
Hi all, first comment here in javaranch =).

Well, i have a dude in generics and wilcards.

The next is not allowed=
List<Animal> list = new ArrayList<Dog>()

Of course, polymorphism with generics get us to a nice compiler error.

But with wilcards, isnt it the same?

List<? extends Animal> list = new ArrayList<Dog>();
is ok, i think...

But with return types, is this ok?

public List<? extends Animal> maybeGetDogs(List<Animal>

List<Dog> dog = maybeGetDogs(animals);

And about the code wich wrote our friend in the first post, what does it throw? I think compiler error, because in runtime there arent generics...

-A pleasure write here.Thanks for all, and sorry for my english -spanish, lot of sun and beach and bulls, but bad english.