Showing posts with label JAVA Programming. Show all posts
Showing posts with label JAVA Programming. Show all posts
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.....!!!
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.....!!!
Thursday, September 29, 2011
//
Labels:
JAVA Programming
//
0
comments
//
1. | Which four options describe the correct default values for array elements of the types indicated? 1. int -> 0 2. String -> "null" 3. Dog -> null 4. char -> '\u0000' 5. float -> 0.0f 6. boolean -> true | |||||||||
| ||||||||||
| 2. Which one of these lists contains only Java programming language keywords? | ||||||||||
|
Wednesday, August 17, 2011
//
Labels:
JAVA Programming
//
0
comments
//
Popular Posts
-
list of cups and trophies (Associated with Sports and Games) Sport: Hockey Aga khan Cup , Begam Rasul Torphy (woman’s), Maharaja R...
-
1- Who is the Commerce & Industry minister of India? (A). Anand Sharma (B). Kapil Sibbal (C). Salman Khurshid (D). Kamal Nath Ans:...
-
1. Which symbol will be on the face opposite to the face with symbol * ? A. @ B. $ C. 8 D. + 2. Two positions are dice ...
-
1. Which of the following pairs of countries are the signatories of a Gas pipeline deal christened as Peace Pipeline 1) Iran - Iraq 2) Ira...
-
1. A clock shows the time as 6 a.m. If the minute hand gains 2 minutes every hour, how many minutes will the clock gain by 9 p.m.? (a) 30 ...
online materials. Powered by Blogger.
Labels
Arithmetic
(8)
C Programming
(3)
current Affairs
(3)
General Awarens
(5)
JAVA Programming
(2)
Reasoning
(5)
videos
(1)