Java Quiz
- Get link
- X
- Other Apps
Java Quiz
Quiz
- Java is a ________ language.
- weakly typed
- strongly typed
- moderate typed
- none
- How many primitive data types are there in java?
- 6
- 7
- 8
- 9
- Size of int in java is
- 16 bit
- 32 bit
- 64 bit
- Depends on environment
- Smallest integer type is__________ and its size is ______ bits.
- short, 8
- byte, 8
- short, 16
- byte, 16
- In Java byte, short, int and long all of these are
- signed
- unsigned
- both
- none
- In java arrays are
- objects
- object references
- primitive data type
- none
- What will be the return type of a method that not returns any value?
- void
- double
- int
- none
- Which of the following options is the best for generating random integer 0 or 1 ?
- (int)Math.random()
- (int)Math.random() + 1
- (int)(Math.random() + 0.5)
- (int)(Math.random() + 0.2)
- What is Math.floor(3.6)?
- 3.0
- 3
- 4
- 4.0
- The class at the top of exception class hierarchy is _______
- Arthimetic Exception
- Throwable
- Object
- Exception
- In which of the following package Exception class exist?
- java.util
- java.file
- java.io
- java.lang
- Exception generated in try block is caught in ______ block.
- catch
- throw
- throws
- finally
- Which keyword is used to explicitly throw an exception?
- try
- throwing
- catch
- throw
- Which exception is thrown when divide by zero statement executes?
- Number Format Exception
- Arthmetic Exception
- Null Pointer Exception
- none
- System class is defined in______
- java.util package
- java.lang package
- java.io package
- none
- Which of these classes defined in java.io and used for file-hanfling are abstract?
- Input Stream
- Print Stream
- Reader
- A and C
- When comparing java.io.BufferedWriter and java.io.FileWriter, which capability exist as a method in only one of two?
- closing the stream
- flushing the stream
- writing a line separator to the stream
- none
- Which of the following class definitions defines a legal abstract class?
- class A { abstract void unfinished() { } }
- class A { abstract void unfinished(); }
- abstract class A { abstract void unfinished();}
- public abstract class A { abstract void unfinished();}
- Which of the following declares an abstract method in an java class?
- public abstract method();
- public abstract void method();
- public void abstract Method();
- public void method() {}
- Which of the following statements regarding abstract classes are true?
- An abstract class can be extended.
- A subclass of a non-abstract superclass can be abstract.
- A subclass can override a concrete method in a superclass to declare it abstract.
- All of the above.
Comments