Stream

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

Short Ans

1) Reader and write both are super class -


2) Reader and write both are abstract class
3) Read() and write() are two methods for input and print data
4) Java programs automatically import the lava.lang package.
5) System class is present under the lang package.
6) 3 predefine classes of system class are in, out, err
7) The readline() method is used to enter data through keyboard.
8) The scanner class consists next() (Enter dats without space) and nextLine() (enter
data with space) methods.
9) What are the different types of errors in java
a. Runtime Error caused by dividing by zero
b. Compile Time Errors are sometimes also referred to as Syntax errors.
If(a>b);
c. Logical Error: A logic error is when your program compiles and executes, but does
the wrong thing or returns an incorrect result or no output when it should be
returning an output. These errors are detected neither by the compiler nor by JVM.
If(a%2==0))
System.out.println(“Odd No”)
10) In Java there are two types of comments:

a. Single-line comments.
// Single line comment here
b. Multi-line comments.
/*Comment starts
continues
continues
.
.
.
Comment ends*/

You might also like