Raja has Published 760 Articles

How to import external libraries in JShell in Java 9?

raja

raja

Updated on 24-Feb-2020 12:06:57

2K+ Views

JShell is an interactive tool to learn Java language and prototyping Java code. JShell does the work by evaluating the commands that user types into it. This tool works on the principle of REPL (Read-Evaluate-Print-Loop).By default, JShell automatically imports a few useful java packages when the JShell session is started. We can ... Read More

What is an OutOfMemoryError and steps to find the root cause of OOM in Java?

raja

raja

Updated on 24-Feb-2020 11:27:10

1K+ Views

The OutOfMemoryError is thrown by JVM, when JVM does not have enough available memory, to allocate. OutOfMemoryError falls into the Error category in Exception class hierarchy.To generate OutOfMemoryErrorWe will allocate a large chunk of memory, which will exhaust heap memory storage.We will keep on allocating the memory and point will reach, when JVM ... Read More

Explain the architecture of Java Swing in Java?

raja

raja

Updated on 24-Feb-2020 11:08:53

2K+ Views

Java Swing is a set of APIs that provides a graphical user interface (GUI) for the java programs. The Java Swing was developed based on earlier APIs called Abstract Windows Toolkit (AWT). The Java Swing provides richer and more sophisticated GUI components than AWT. The GUI components are ranging from ... Read More

Why Object class is the super class for all classes in Java?

raja

raja

Updated on 24-Feb-2020 10:51:49

4K+ Views

Java.lang.Object class is the root or superclass of the class hierarchy, which is present in java.lang package. All predefined classes and user-defined classes are the subclasses from Object class.Why object class is a superclassRe-usabilityEvery object has 11 common properties, these properties must be implemented by every Java developer.To reduce the burden on ... Read More

How to handle the ArrayStoreException (unchecked) in Java?

raja

raja

Updated on 24-Feb-2020 10:21:25

229 Views

The java.lang.ArrayStoreException is an unchecked exception and it can occur when we try to store an object of a type in an array of objects of a different type. Usually, one would come across java.lang.ArrayStoreException: java.lang.Integer which occurs when an attempt is made to store an integer in an array of different type like ... Read More

How many non-access modifiers are there in Java?

raja

raja

Updated on 24-Feb-2020 08:07:53

133 Views

Java provides some other modifiers to provide the functionalities other than the visibility. These modifiers are called Non-Access ModifiersStatic  The members which are declared as static are common to all instances of a class. Static members are class level members which are stored in the class memory.Final  This modifier is ... Read More

What are new methods have added to the Arrays class in Java 9?

raja

raja

Updated on 24-Feb-2020 06:08:30

164 Views

Arrays class can contain various methods for manipulating arrays and also contains static factory methods that allow arrays to view as a list. Java 9 has added three important methods to Arrays class: Arrays.equals(), Arrays.compare() and Arrays.mismatch().Arrays.equal() − In Java 9, few overloaded methods have added to the Arrays.equals() method. The new ... Read More

StackWalker API in Java 9?

raja

raja

Updated on 24-Feb-2020 06:05:26

577 Views

StackWalker API allows easy filtering and lazy access to execute tasks within any method. It is an efficient API for obtaining stack trace information in Java 9.There are three new important classes in StackWalker API: StackWalker,  StackWalker.StackFrame and StackWalker.Option.StackWalker − It is the main class in StackWalker API. We traverse stack frames by using ... Read More

What are the useful commands in JShell in Java 9?

raja

raja

Updated on 24-Feb-2020 06:03:18

364 Views

Java 9 has introduced a new interactive tool called JShell. This tool can be used to execute, test user-friendly and easy way of java classes, interfaces, enums, objects, statements and etc. JShell can do the work by evaluating the commands that user types into it. It works on the principle of ... Read More

How to define expressions, variables, and methods in JShell in Java 9?

raja

raja

Updated on 24-Feb-2020 05:32:55

705 Views

JShell is a Read-Evaluate-Print Loop (REPL) that evaluates declarations, statements, and expressions as we have entered and immediately shows the results. This tool is run from the command prompt.In the below, we can define expressions, variables, and methods in JShell.ExpressionWe can type any valid Java expression in JShell. The expression is either ... Read More

Advertisements