NEW ****Numerical Ability**** NEW




JAVA Interview Questions1

Q1. How could Java classes direct program messages to the system console, but error messages, say to a file?

A. The class System has a variable out that represents the standard output, and the variable err that represents the standard error device. By default, they both point at the system console. This how the standard output could be re-directed:
Stream st = new Stream(new FileOutputStream("output.txt")); System.setErr(st); System.setOut(st);

*Q2. What's the difference between an interface and an abstract class?

A. An abstract class may contain code in method bodies, which is not allowed in an interface. With abstract classes, you have to inherit your class from it and Java does not allow multiple inheritance. On the other hand, you can implement multiple interfaces in your class.


more.....!!!



0 comments to "JAVA Interview Questions1"

Post a Comment

Popular Posts

online materials. Powered by Blogger.

This Blog to Your Language

English French German Spain Italian Dutch Russian Portuguese Japanese Korean Arabic Chinese Simplified

Total Pageviews

Calender

Followers