Skip to content

Programming Articles

  • HOME
  • Python
  • JavaScript
  • C/C++
  • Java
  • Terms & Conditions and Privacy Policy
  • About US
Main Menu

Java

Java

What is the main difference between an inner class and a static nested class in Java?

In this article, we’ll discuss the main difference between an inner class and a static nested class in Java. From the Java Tutorial: Nested classes are divided into two categories: static …

What is the main difference between an inner class and a static nested class in Java? Learn More
Java

How to break out of nested loops in Java?

Technically the correct answer is to label the outer loop. In practice if you want to exit at any point inside an inner loop then you would be better off …

How to break out of nested loops in Java? Learn More
Java

Top Java Programming Interview Questions

What is Java?  Java is the high-level programming language that was developed by James Gosling in the year 1982. It is based on the principles of object-oriented programming and can …

Top Java Programming Interview Questions Learn More
Java

How to create a generic array in Java?

You can do this: This is one of the suggested ways of implementing a generic collection in Effective Java; Item 26. No type errors, no need to cast the array repeatedly. However this …

How to create a generic array in Java? Learn More
Java

How to convert an ArrayList object to a String[] array in Java?

For example: The toArray() method without passing any argument returns Object[]. So you have to pass an array as an argument, which will be filled with the data from the list and returned. …

How to convert an ArrayList object to a String[] array in Java? Learn More
Java

What are the possible values of the Hibernate hbm2ddl.auto configuration and what do they do?

From the community documentation: hibernate.hbm2ddl.auto Automatically validates or exports schema DDL to the database when the SessionFactory is created. With create-drop, the database schema will be dropped when the SessionFactory is …

What are the possible values of the Hibernate hbm2ddl.auto configuration and what do they do? Learn More
Java

How can I initialize a static Map in Java?

The instance initialiser is just syntactic sugar in this case, right? I don’t see why you need an extra anonymous class just to initialize. And it won’t work if the …

How can I initialize a static Map in Java? Learn More
Java

How to initialize a static Map in Java?

Sample query: How would you initialise a static Map in Java? Method one: static initialiserMethod two: instance initialiser (anonymous subclass) or some other method? What are the pros and cons of each? …

How to initialize a static Map in Java? Learn More
Java

Can’t execute jar- file: “no main manifest attribute” | Java [Answered]

Problem statement: I have installed an application, when I try to run it (it’s an executable jar) nothing happens. When I run it from the commandline with: java -jar “app.jar” …

Can’t execute jar- file: “no main manifest attribute” | Java [Answered] Learn More
Android / Java

Android SDK installation doesn’t find JDK? [Solved]

Sample query: I’m trying to install the Android SDK on my Windows 7 x64 System. jdk-6u23-windows-x64.exe is installed, but the Android SDK setup refuses to proceed because it doesn’t find the JDK installation. Is this …

Android SDK installation doesn’t find JDK? [Solved] Learn More
Java / JSON

How to parse JSON in Java?

The org.json library is easy to use. Just remember (while casting or using methods like getJSONObject and getJSONArray) that in JSON notation [ … ] represents an array, so library will parse it to JSONArray { … …

How to parse JSON in Java? Learn More
Java

How to get the current working directory in Java?

In Java, the current working directory can be found using the following code: Code : This will print the absolute path of the current directory from where your application was …

How to get the current working directory in Java? Learn More
Java

How to add elements to a hashmap in Java?

Use the put() method to add elements to a HashMap in Java. In this post, we’ll learn more than just how to add elements to a HashMap in Java. How …

How to add elements to a hashmap in Java? Learn More
Formatted Codes / Java

How to convert a String to int in Java?

Query: My String contains only numbers, and I want to return the number it represents. For example, given the string “1234” the result should be the number 1234. In this post, I’ll convert …

How to convert a String to int in Java? Learn More
Explanations / Java

What is serialVersionUID in Java?

Query explained: Eclipse issues warnings when a serialVersionUID is missing. The serializable class Foo does not declare a static final serialVersionUID field of type long What is serialVersionUID and why is it important? Please …

What is serialVersionUID in Java? Learn More
Java / Language agnostic

What is dependency injection?

Dependency injection means giving an object its instance variables. Really. That’s it. The best definition I’ve found so far is one by James Shore: “Dependency Injection” is a 25-dollar term for …

What is dependency injection? Learn More
Explanations / Java

What is the difference between ArrayList and LinkedList in Java?

Query: I’ve always been one to simply use: I use the interface as the type name for portability, so that when I ask questions such as these I can rework my …

What is the difference between ArrayList and LinkedList in Java? Learn More

Posts navigation

1 2 … 4 Next

Featured Posts

History of UNIX

From UNIX to Linux – History of Linux

21st November 202013th November 2021

Top themes for Ubuntu

Best themes for Ubuntu: Make Ubuntu Beautiful

20th October 202029th November 2021

Strings in Python

Strings in Python

12th September 202010th November 2021

is python hard to learn

Is Python hard to learn? Top best learning resources

18th April 202013th November 2021

Recent posts

  • How to recursively grep all directories and subdirectories?
  • How to merge two Git repositories?
  • What is the main difference between an inner class and a static nested class in Java?
  • RegEx to match open tags except XHTML self-contained tags
  • How to count the occurrences of a list item in Python?
  • Why is it string.join(list) instead of list.join(string)?
Copyright © 2022 Programming Articles.
Powered by WordPress and HitMag.