Nested Switch in Java

In this article, we will discuss about nested switch in Java with examples. When a switch statement contains further switch statements inside it, then it is called a nested switch. Inside the nested switch statement, we can give multiple cases and a default case. The inner switch statement must be part of any outer case statement. We cannot use the inner switch statements outside the cases.

Read more

How to Get Filename Without Extension in Java

This article will talk about how to get filename without extension in Java language. The file utility method helps you to get rid of the file extension from the file name. Here is an example. Program:


Explanation: We take a file named ‘myfile’ with the extension ‘.java’. Next, we check whether the filename contains ‘.’ or not. If it contains ‘.’, then go to the else part and get filename without an extension using substring() function. This

Read more

Java Control Flow Statements

To plan or decide something before implementation is always essential. This will help execute every step more efficiently, and you have an idea about the action that to be performed next. In computer language, decision-making is an important part. Predominantly, the execution starts from the top to the bottom. But sometimes, the decision is vital to know which block needs to perform next. Control flow in Java will help you to decide the next action. This article gives detailed information

Read more

Nested While Loop in Java

It is pretty impossible to impose hundreds of words or numbers by just writing or putting into variable one by one. Instead, use a loop to avoid extra time. This article gives an overview of nested while loop in Java and how to use them. Why use loops? Loops are the programming structure of an operation that repeats in a specific sequence until the particular condition or procedure is completed. Loops follow the don’t repeat yourself (DRY) principle for complete

Read more

Basic Structure of Java Program with Example

Java is a very popular language and used on 7 billion devices worldwide. It is one of the most secured, platform-independent, and object oriented programming languages that’s why it is necessary to be familiar with the basic structure of Java program. A typical Java program consists of the following sections: Package statements Documentation Section Import statements Class definition Interface statements Methods Main method class Basic Structure of Java Program Image Source Package Statements It is optional to write in your

Read more

What is Native Method in Java?

Java uses various concepts to maintain privacy, structural format, and handling data efficiently, and many others. From all these concepts, one is to increase portability. To make the programs in Java more portable across all the platforms, the Java native interface (JNI) concept comes into the frame. JNI give out a bridge between Java and other native application. JNI is a segment of JDK (Java Development Kit), where JDK prefaces the java bytecode and the native programs (C and C++)

Read more

Best Way to Learn Java for a Beginner

Here you will know what is the best way to learn java for a beginner. Programming is the new vogue and a vogue which can make you earn wonders and at the same time make you utilize the capabilities of your brain to the fullest. Learning new programming languages however can sometimes turn out to be challenging especially when the language is one which holds immense importance in various fields. Java is definitely one of those languages which most of

Read more

How Clean Coding Principles Can Help You Lower the TOC of Your Software Development Lifecycle

Writing clean code is a matter of skill as much as it is a personal habit. For 25 years, since the Java programming language was launched it has evolved, and the Java coding practices have advanced too. To achieve your desired goal of the software, application or product you intend to produce, you need to have a set of coding principles that will guide you when creating code. These coding principles will form the essence of writing clean Java code,

Read more
1 2 3 7