This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
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


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
 
Have you checked out Aspose?
 
subject: "this" ???
 
It's not a secret anymore!