Java Capitalize First Letter of Each Word
The Java Programmer
by Pulkit Govrani
1M ago
In this blog, we will see how to capitalize the first character of each word present in a given string. There can be two different ways to achieve our desired result. Let us see both of them one after another. 1. Using Split Function with for Loop Code: import java.util.Scanner; public class capitalize { public static String char_capital (String input_str) { String words_string[] = input_str.split ("\\s"); String result_string = ""; for (int ind=0; ind < words_string.length ; ind++) { String single_word = words_string[ind ..read more
Visit website
How to Exit Program in Java?
The Java Programmer
by Pulkit Govrani
2M ago
We have System.exit() method in java which is responsible for exiting the running program by terminating the JVM (Java Virtual Machine). In this blog, we will be learning about this exit method in a more detailed way along with suitable examples. The exit method is available in the java.lang.System Class. Whenever we face an abnormal condition and it is necessary to terminate the program then we call this exit method. Instead of throwing exceptions, we can use the exit method which tells the error present in the program. System.exit() – Terminates Program or Method exit() can take different pa ..read more
Visit website
9 Best Youtube Channels to Learn Programming 2022
The Java Programmer
by Zainab Sutarwala
3M ago
Learning how to code can seem like an intimidating process – it’s easy to feel lost and confused when you’re first getting started. It’s especially easy to get lost if you’re working on your own, without access to any friends or a knowledgeable person who can help you out along the way. If you want to learn how to code, though, one of the best ways to do it is through YouTube channels – not only are they free, but they also allow you to learn at your own pace and without feeling pressured by other students in a class setting. There’s no need to attend university to learn how to code! In fact ..read more
Visit website
Why Java Does Not Support Destructor?
The Java Programmer
by Pulkit Govrani
5M ago
In any programming language, whenever we declare and create an object it takes some bytes of memory in the heap memory. After the usage of the objects, we need to delete them from heap memory as they might be responsible for taking some unwanted space. Let’s assume we forget to remove them and you are not able to write your program completely. This will suggest that our heap memory is exhausted completely. So destructors are used to free memory by destroying unwanted objects. Does Java Support Destructor? In Java, we don’t have specific destructors. Java already contains a garbage collector wh ..read more
Visit website
James Gosling Biography – Father of Java Programming Language
The Java Programmer
by Neeraj Mishra
6M ago
James Gosling is the name that easily comes to one’s mind when we think of pioneers of programming language. Born in Canada, in May 1955, James Arthur Gosling went on to become the founder and lead designer of Java Programming Language. Education & Early Life Gosling studied at William Aberhart High School in Calgary, Alberta, which was also his hometown. Having completed his Bachelor’s degree in Computer Science from the University of Calgary, James Gosling did his Master’s and Ph.D. in the same major at Carnegie Mellon University. He did his doctoral thesis on ‘The Algebraic Manipulation ..read more
Visit website
Solve “Requested array size exceeds VM limit” Error in Java
The Java Programmer
by Pulkit Govrani
7M ago
There is a limit on the declaration of maximum array size in java. So whenever we face the OutOfMemoryError i.e, Requested array size exceeds VM limit it means that the program is trying to allocate a particular size to an array that is larger than the size supported by the virtual machine. Cause of Error The value of maximum positive integer in java is 2^31 – 1 = 2,147,483,647. Now it depends on the specifications of the different operating systems whether it allows creating an array of size Integer.MAX_VALUE – 1 or Integer.MAX_VALUE – 2 or much lesser than both of these. The need to create s ..read more
Visit website
Exception Hierarchy in Java
The Java Programmer
by Pulkit Govrani
9M ago
Whenever any unexpected event like if required Index is more than the array size happens, it results in the stopping of the program. The name of this condition is an “Exception”. There are many types of exceptions occurred in java, and there is a certain hierarchy followed by java. We will be exploring this hierarchy through this blog. “Throwable class” is the topmost class in the hierarchy. It is mainly divided into 2 types which are Exception class and Error class. Image Source Errors Errors are problems that are happening due to failures in the system or Java virtual machine (JVM). One com ..read more
Visit website
6 Best Online Java Courses for Beginners in 2022
The Java Programmer
by Zainab Sutarwala
11M ago
If you dream to be a programmer, creating apps or learning to code, then Java is the best programming language that you must consider working with. In today’s post, we will check out the best Java courses for beginners and advanced developers. These courses and tutorials can help you learn and improve your java programming skills. Without wasting any time, let us check out some best java courses for beginners: 1. Java Programming Masterclass by Udemy Java Programming Masterclass covering Java 11 & Java 17 is probably a highly popular Java course with more than 607,000 students that have e ..read more
Visit website
Solve Error Java Access Denied FileNotFoundException
The Java Programmer
by Pulkit Govrani
11M ago
In this blog I will be sharing the reasons due to which you are getting Access is denied i.e, File Not Found Exception, and will solve the error as well. So let’s start and solve this error in your system. This error occurs for various reasons, let’s discuss them one by one in detail. 1. Opening or Trying to Read a Folder/Directory It is not possible for the user to see the directory as we do normally and if you try to do that it will result in the exception. Let us check the program written below and the output on the console for better understanding. import java.io.File ; import java.io.IOE ..read more
Visit website
Custom Iterator in Java with Example
The Java Programmer
by Pulkit Govrani
11M ago
Through this blog, I will be sharing how can we make a custom iterator in Java. Iterators can come in handy in many situations. An iterator is basically an object which can help us to go over a collection, it can serve as an alternative to foreach loop. So let’s explore more about custom iterators and their functionality. Custom Iterators are made when we take a class that is implementing iterator and then we override the functions. Majorly we override the hasNext(), next(), and remove() functions. Let us see the below code example for better understanding. customiterator.java import java.uti ..read more
Visit website

Follow The Java Programmer on Feedspot

Continue with Google
OR