aspose file tools*
The moose likes Beginning Java and the fly likes Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark ""this" ??? " Watch ""this" ??? " New topic
Author

"this" ???

pras
Ranch Hand

Joined: Apr 04, 2007
Posts: 188
public class Test6{
public Test6(){
this(4);/***********??? ****/
}
public Test6(byte var){
System.out.println(var);
}
public static void main(String[] args){
Test6 t6 = new Test6();
}
}
/**** why is 4 not passed to public Test6 constructer?
John Dell'Oso
Ranch Hand

Joined: Apr 08, 2004
Posts: 130
Have a look at this:



The second constructor is expecting a byte. You have to use a cast as the literal 4 is assumed to be an integral type.

Regards,
JD
[ August 01, 2007: Message edited by: John Dell'Oso ]
pras
Ranch Hand

Joined: Apr 04, 2007
Posts: 188
thanks john
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: "this" ???
 
Similar Threads
constructor doubt
constructor doubt
constructor doubt
Constructors question
HashSet Duplicate element ?