aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Easy Queries Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Easy Queries" Watch "Easy Queries" New topic
Author

Easy Queries

Mohit G Gupta
Ranch Hand

Joined: May 18, 2010
Posts: 634

how is Interface is a java.lang.object

what's difference between format and printf in java.io.Console ?


OCPJP 6.0 93%
OCPJWCD 5.0 98%
Abimaran Kugathasan
Ranch Hand

Joined: Nov 04, 2009
Posts: 2066

mohitkumar gupta wrote:how is Interface is a java.lang.object

It's in polymorphic way! What do you assign for Interface references?

|BSc in Electronic Eng| |SCJP 6.0 91%| |SCWCD 5 92%|
Matthew Brown
Bartender

Joined: Apr 06, 2010
Posts: 4390
    
    8

mohitkumar gupta wrote:what's difference between format and printf in java.io.Console ?

Other than the name, nothing whatsoever. format is the "natural" name, printf is there for familiarity for C/C++/etc users, as it's very similar to the function of that name in those languages.

As the API docs say:
Java API wrote:A convenience method to write a formatted string to this console's output stream using the specified format string and arguments.

An invocation of this method of the form con.printf(format, args) behaves in exactly the same way as the invocation of con.format(format, args)
Prasad Kharkar
Ranch Hand

Joined: Mar 07, 2010
Posts: 440

every class in java extends Object class
and any class can implement any interface
hence that interface IS-A Object

but that interface is NOT in the inheritance tree


SCJP 6 [86%] June 30th, 2010
OCPWCD [84%] March 26th, 2012
OCEJPAD [83%] September 6th, 2014
If you find any post useful, click the "plus one" sign on the right
Mohit G Gupta
Ranch Hand

Joined: May 18, 2010
Posts: 634


One more Query



THE Line gives error

WHY ?


can't byte be cast to Character ?

but it's allowed to cast byte,int to char
Abimaran Kugathasan
Ranch Hand

Joined: Nov 04, 2009
Posts: 2066

mohitkumar gupta, There are in the same level in the hierarchy! You can't cast one type to another which are in the same level.!
Mohit G Gupta
Ranch Hand

Joined: May 18, 2010
Posts: 634

Thanks
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Easy Queries