Java

Java is a simple, secured, high level, platform-independent, multithread, Object-oriented programming language.

 

It’s one of the most popular and widely used programming language, platform, and technology. Java is not only a language it is also a platform and technology.

 

Related Pages:-

Java try-catch MCQ – 1

Exception Handling MCQ Part – 4 | Java try-catch MCQ – 1 | Also see:- Exception Handling Interview Questions in Java, MCQ in Java Q1) Find the output of the below Java program? a) ABb) CDc) ABCDEd) ArithmeticException View Answer Answer:- d) ArithmeticException Exception in thread “main” java.lang.ArithmeticException: / by zero; at Test.main(Test.java:3). The “System.out.print(9/0);” […]

Java try-catch MCQ – 1 Read More »

Java Exception Handling MCQ-3

Q1) Which exception will be raised? a) StackOverflowErrorb) OutOfMemoryErrorc) UnknownErrord) VirtualMachineError View Answer Answer:- a) StackOverflowError In Java, every thread keeps a record of method calls inside the stack. In this program, the m1() method is called the m2() method and the m2() method is called m1() method therefore StackOverflowError will be raised. Q2) Which

Java Exception Handling MCQ-3 Read More »

Java Exception Handling MCQ-2

Q1) What are the different methods that can be used to get the exception message? a) printStackTrace()b) toString()c) getMessage()d) All of these View Answer Answer:- d) All of these We can use printStackTrace(), toString(), and getMessage() to get the exception message. See More:- Different Ways to Get Exception Message in Java Q2) The below exception

Java Exception Handling MCQ-2 Read More »

Java Exception Handling MCQ – 1

Q1) Which class acts as the root for all Java exception Hierarchy? a) Exception classb) Throwable classc) Error classd) None of these View Answer Answer:- b) Throwable class Q2) Which option is true? a) Throwable is an interface.b) Throwable is an abstract class.c) Throwable is a class.d) Throwable is an Enum. View Answer Answer:- c)

Java Exception Handling MCQ – 1 Read More »

Catch All Exceptions in Java

How to catch all exceptions in Java? In Java, We can catch all exceptions with a single catch block using the “java.lang.Exception” parameter. We should use this catch block only for stopping abnormal terminations irrespective of the exception thrown from its corresponding try statement.  Note:- We can’t handle Error type exceptions either by using catch

Catch All Exceptions in Java Read More »

String Pattern Programs in Java

String Pattern Programs in Java | In this post, we will develop many String Pattern Programs in Java. For example:- Half pyramid string pattern, Half diamond string pattern, Mirrored half diamond string pattern, and e.t.c. String Pattern Programs in Java – 1 | Write a Java program to print the given below pattern. Solve this

String Pattern Programs in Java Read More »

Nested try-catch in Java

Nested try-catch in Java | In Java, we can use a try-catch block within another try-catch block. The try-catch placed inside another try/catch/finally is called the inner try-catch block. Example of nested try-catch in Java:- There are some situations when there is a chance of raising an exception inside try/catch/finally which can lead to an

Nested try-catch in Java Read More »

Exception Propagation in Java

Exception Propagation in Java | The process of sending an exception from called method to calling method is called exception propagation. Whenever an exception is propagated & that exception is not caught in the calling method then execution of both called and calling method is terminated abnormally. Let us understand it through an example, Output:-

Exception Propagation in Java Read More »