
- Java - Home
- Java - Overview
- Java - History
- Java - Features
- Java Vs. C++
- JVM - Java Virtual Machine
- Java - JDK vs JRE vs JVM
- Java - Environment Setup
- Java - Hello World Program
- Java - Comments
- Java - Basic Syntax
- Java - Variables
- Java - Data Types
- Java - Type Casting
- Java - Unicode System
- Java - User Input
- Java - Date & Time
Java Operators
- Java - Operators
- Java - Arithmetic Operators
- Java - Assignment Operators
- Java - Relational Operators
- Java - Logical Operators
- Java - Bitwise Operators
- Java Operator Precedence & Associativity
Java Control Statements
- Java - Decision Making
- Java - If Else Statement
- Java - Switch Statement
- Java - Loop Control
- Java - For Loop
- Java - For-Each Loop
- Java - While Loop
- Java - Do While Loop
- Java - Break Statement
- Java - Continue Statement
Object Oriented Programming
- Java - OOPs Concepts
- Java - Object & Classes
- Java - Class Attributes
- Java - Class Methods
- Java - Methods
- Java - Variables Scope
- Java - Constructors
- Java - Access Modifiers
- Java - Inheritance
- Java - Aggregation
- Java - Polymorphism
- Java - Overriding
- Java - Method Overloading
- Java - Dynamic Binding
- Java - Static Binding
- Java - Instance Initializer Block
- Java - Abstraction
- Java - Encapsulation
- Java - Interfaces
- Java - Packages
- Java - Inner Classes
- Java - Static Class
- Java - Anonymous Class
- Java - Singleton Class
- Java - Wrapper Classes
- Java - Enums
- Java - Enum Constructor
- Java - Enum Strings
Java Built-in Classes
Java File Handling
- Java - Files
- Java - Create a File
- Java - Write to File
- Java - Read Files
- Java - Delete Files
- Java - Directories
- Java - I/O Streams
Java Error & Exceptions
- Java - Exceptions
- Java - try-catch Block
- Java - try-with-resources
- Java - Multi-catch Block
- Java - Nested try Block
- Java - Finally Block
- Java - throw Exception
- Java - Exception Propagation
- Java - Built-in Exceptions
- Java - Custom Exception
Java Multithreading
- Java - Multithreading
- Java - Thread Life Cycle
- Java - Creating a Thread
- Java - Starting a Thread
- Java - Joining Threads
- Java - Naming Thread
- Java - Thread Scheduler
- Java - Thread Pools
- Java - Main Thread
- Java - Thread Priority
- Java - Daemon Threads
- Java - Thread Group
- Java - Shutdown Hook
Java Synchronization
- Java - Synchronization
- Java - Block Synchronization
- Java - Static Synchronization
- Java - Inter-thread Communication
- Java - Thread Deadlock
- Java - Interrupting a Thread
- Java - Thread Control
- Java - Reentrant Monitor
Java Networking
- Java - Networking
- Java - Socket Programming
- Java - URL Processing
- Java - URL Class
- Java - URLConnection Class
- Java - HttpURLConnection Class
- Java - Socket Class
- Java - Generics
Java Collections
Java Interfaces
- Java - List Interface
- Java - Queue Interface
- Java - Map Interface
- Java - SortedMap Interface
- Java - Set Interface
- Java - SortedSet Interface
Java Data Structures
Java Collections Algorithms
Advanced Java
- Java - Command-Line Arguments
- Java - Lambda Expressions
- Java - Sending Email
- Java - Applet Basics
- Java - Javadoc Comments
- Java - Autoboxing and Unboxing
- Java - File Mismatch Method
- Java - REPL (JShell)
- Java - Multi-Release Jar Files
- Java - Private Interface Methods
- Java - Inner Class Diamond Operator
- Java - Multiresolution Image API
- Java - Collection Factory Methods
- Java - Module System
- Java - Nashorn JavaScript
- Java - Optional Class
- Java - Method References
- Java - Functional Interfaces
- Java - Default Methods
- Java - Base64 Encode Decode
- Java - Switch Expressions
- Java - Teeing Collectors
- Java - Microbenchmark
- Java - Text Blocks
- Java - Dynamic CDS archive
- Java - Z Garbage Collector (ZGC)
- Java - Null Pointer Exception
- Java - Packaging Tools
- Java - Sealed Classes
- Java - Record Classes
- Java - Hidden Classes
- Java - Pattern Matching
- Java - Compact Number Formatting
- Java - Garbage Collection
- Java - JIT Compiler
Java Miscellaneous
- Java - Recursion
- Java - Regular Expressions
- Java - Serialization
- Java - Strings
- Java - Process API Improvements
- Java - Stream API Improvements
- Java - Enhanced @Deprecated Annotation
- Java - CompletableFuture API Improvements
- Java - Streams
- Java - Datetime Api
- Java 8 - New Features
- Java 9 - New Features
- Java 10 - New Features
- Java 11 - New Features
- Java 12 - New Features
- Java 13 - New Features
- Java 14 - New Features
- Java 15 - New Features
- Java 16 - New Features
Java APIs & Frameworks
Java Class References
- Java - Scanner
- Java - Arrays
- Java - Strings
- Java - Date
- Java - ArrayList
- Java - Vector
- Java - Stack
- Java - PriorityQueue
- Java - LinkedList
- Java - ArrayDeque
- Java - HashMap
- Java - LinkedHashMap
- Java - WeakHashMap
- Java - EnumMap
- Java - TreeMap
- Java - IdentityHashMap
- Java - HashSet
- Java - EnumSet
- Java - LinkedHashSet
- Java - TreeSet
- Java - BitSet
- Java - Dictionary
- Java - Hashtable
- Java - Properties
- Java - Collection
- Java - Array
Java Useful Resources
Java 8 Mock Test
This section presents you various set of Mock Tests related to Java 8. You can download these sample mock tests at your local machine and solve offline at your convenience. Every mock test is supplied with a mock test key to let you verify the final score and grade yourself.

Java 8 Mock Test I
Q 1 - Which of the following is correct about Java8?
A - Lambda expression - Adds functional processing capability to Java.
C - Default method - Interface to have default method implementation.
Answer : D
Explanation
All of the above options are correct.
Q 2 - Which of the following is correct about Java8?
A - New compiler tools and utilities are added like 'jdeps' to figure out dependencies.
B - New stream API to facilitate pipeline processing is added.
Answer : D
Explanation
All of the above options are correct.
Q 3 - Which of the following is correct about Java 8 lambda expression?
Answer : C
Explanation
Both of the above options are correct.
Q 4 - Which of the following is correct about Java 8 lambda expression?
Answer : C
Explanation
Both of the above options are correct.
Q 5 - Which of the following is correct about Java 8 lambda expression?
A - Lambda expressions are used primarily to define inline implementation of a functional interface.
Answer : C
Explanation
Both of the above options are correct.
Q 6 - Which of the following is correct about Java 8 lambda expression?
B - Lambda expression throws a compilation error, if a variable is assigned a value the second time.
Answer : C
Explanation
Both of the above options are correct.
Q 7 - Which of the following is correct about Java 8 method references?
A - Method references help to point to methods by their names.
B - A method reference is described using :: (double colon) symbol.
Answer : C
Explanation
Both of the above options are correct.
Q 8 - Which of the following is correct about System.out::println expression?
Answer : A
Explanation
System.out::println method is a static method reference to println method of out object of System class.
Q 9 - Which of the following functional interface represents an operation that accepts two input arguments, and returns no result?
Answer : A
Explanation
BiConsumer<T,U> functional interface represents an operation that accepts two input arguments, and returns no result.
Q 10 - Which of the following functional interface represents an operation that accepts two input arguments, and returns a result?
Answer : B
Explanation
BiFunction<T,U> functional interface represents an operation that accepts two input arguments, and returns a result.
Q 11 - Which of the following functional interface represents an operation upon two operands of the same type, producing a result of the same type as the operands?
Answer : C
Explanation
BinaryOperator<T> functional interface represents an operation upon two operands of the same type, producing a result of the same type as the operands.
Q 12 - Which of the following functional interface represents a predicate (Boolean-valued function) of two arguments?
Answer : D
Explanation
BiPredicate<T,U> functional interface represents a predicate (Boolean-valued function) of two arguments.
Q 13 - Which of the following functional interface represents a supplier of Boolean-valued results?
Answer : A
Explanation
BooleanSupplier functional interface represents a supplier of Boolean-valued results.
Q 14 - Which of the following functional interface represents an operation that accepts a single input argument and returns no result?
Answer : B
Explanation
Consumer<T> functional interface represents an operation that accepts a single input argument and returns no result.
Q 15 - Which of the following functional interface represents an operation upon two double-valued operands and producing a double-valued result?
Answer : C
Explanation
DoubleBinaryOperator functional interface represents an operation upon two double-valued operands and producing a double-valued result.
Q 16 - Which of the following functional interface represents an operation that accepts a single double-valued argument and returns no result?
Answer : D
Explanation
DoubleConsumer functional interface represents an operation that accepts a single double-valued argument and returns no result.
Q 17 - Which of the following functional interface represents a function that accepts a double-valued argument and produces a result?
Answer : A
Explanation
DoubleFunction<R> functional interface represents a function that accepts a double-valued argument and produces a result.
Q 18 - Which of the following functional interface represents a predicate of one double-valued argument?
Answer : B
Explanation
DoublePredicate functional interface represents a predicate (Boolean-valued function) of one double-valued argument.
Q 19 - Which of the following functional interface represents a supplier of double-valued results?
Answer : C
Explanation
DoubleSupplier functional interface represents a supplier of double-valued results.
Q 20 - Which of the following functional interface represents a function that accepts a double-valued argument and produces an int-valued result?
Answer : D
Explanation
DoubleToIntFunction functional interface represents a function that accepts a double-valued argument and produces an int-valued result.
Q 21 - Which of the following functional interface represents a function that accepts a double-valued argument and produces a long-valued result?
Answer : A
Explanation
DoubleToLongFunction functional interface represents a function that accepts a double-valued argument and produces a long-valued result.
Q 22 - Which of the following functional interface represents an operation on a single double-valued operand that produces a double-valued result?
Answer : B
Explanation
DoubleUnaryOperator functional interface represents an operation on a single double-valued operand that produces a double-valued result.
Q 23 - Which of the following functional interface represents a function that accepts one argument and produces a result?
Answer : C
Explanation
Function<T,R> functional interface represents a function that accepts one argument and produces a result.
Q 24 - Which of the following functional interface represents an operation upon two int-valued operands and produces an int-valued result?
Answer : D
Explanation
FunctionIntBinaryOperator functional interface represents an operation upon two int-valued operands and produces an int-valued result.
Q 25 - Which of the following functional interface represents an operation that accepts a single int-valued argument and returns no result?
Answer : A
Explanation
IntConsumer functional interface represents an operation that accepts a single int-valued argument and returns no result.
Answer Sheet
Question Number | Answer Key |
---|---|
1 | D |
2 | D |
3 | C |
4 | C |
5 | C |
6 | C |
7 | C |
8 | A |
9 | A |
10 | B |
11 | C |
12 | D |
13 | A |
14 | B |
15 | C |
16 | D |
17 | A |
18 | B |
19 | C |
20 | D |
21 | A |
22 | B |
23 | C |
24 | D |
25 | A |