entanglement 15 de out. de 2010
marciosouzajunior 15 de out. de 2010
damianijr 15 de out. de 2010
Siga as regras:
Ampliação
Autoboxing
Varargs
você passou um short, ele ampliou, acho o int e executou o método
você passou um long, ele não achou ampliação, mas achou o boxing… Long…
marciosouzajunior 15 de out. de 2010
Ok pessoal, obrigado pelas dicas.
Flavio_machine 15 de out. de 2010
Valeu me ajudou tb. To estudando essa praga tb, que exitem 0,0000000000000000000000000001% de vc utilizar;
Milton_Quirino 14 de mar. de 2012
Pessoal,
Peguei esse exercicio e complementei ele, quem quiser fazer para fixar =)
public class Yikes {
public static void go ( Object o ) {
System . out . println ( "Objeto " );
}
public static void go ( Long n ) {
System . out . println ( "Long " );
}
public static void go ( long n ) {
System . out . println ( "long " );
}
public static void go ( Short n ) {
System . out . println ( "Short " );
}
public static void go ( short n ) {
System . out . println ( "short " );
}
public static void go ( Integer n ) {
System . out . println ( "Integer " );
}
public static void go ( int n ) {
System . out . println ( "int " );
}
public static void go ( Float n ) {
System . out . println ( "Float " );
}
public static void go ( float n ) {
System . out . println ( "float " );
}
public static void main ( String [] args ) {
short y = 6 ;
Short a = 2 ;
long z = 7 ;
Long b = new Long ( "1" );
String k = "5" ;
int t = Integer . parseInt ( k );
Integer x = 8 ;
int c = 9 ;
float h = 2.5f ;
Float i = 2.6f ;
Double d = 6d ;
byte g = 127 ;
int o = 1 ;
System . out . print ( + ( o ++ ) + " - " );
go ( a );
System . out . print ( + ( o ++ ) + " - " );
go ( y );
System . out . print ( + ( o ++ ) + " - " );
go ( a );
System . out . print ( + ( o ++ ) + " - " );
go ( z );
System . out . print ( + ( o ++ ) + " - " );
go ( b );
System . out . print ( + ( o ++ ) + " - " );
go ( k );
System . out . print ( + ( o ++ ) + " - " );
go ( t );
System . out . print ( + ( o ++ ) + " - " );
go ( x );
System . out . print ( + ( o ++ ) + " - " );
go ( c );
System . out . print ( + ( o ++ ) + " - " );
go ( h );
System . out . print ( + ( o ++ ) + " - " );
go ( i );
System . out . print ( + ( o ++ ) + " - " );
go ( d );
System . out . print ( + ( o ++ ) + " - " );
go ( g );
}
}