HTML

How to Count number of 1s (Set Bits) in Given Bit Sequence in Java

Good morning folks, In today's article, we are going to discuss one of the frequently asked bit manipulation based interview question, how do you count the number of set bits in given bit sequence?  Bit Manipulation is an important topic on programming interview and a good programmer should have sufficient knowledge and skill to work with binary numbers. This kind of questions tests that skill of the programmer. Sometimes, it is also asked as for how to count the number of 1s (ones) in given number? Both are the same question because 1 is also known as set bit.  For example, if given input is 1000110010 than your program should return 4, as three are only four set bits in this bit sequence.

Can you Make a Class Static in Java? Interview Question

This is one of the tricky questions in Java because there is no straight forward Yes and No answer here. You cannot make a top level class static in Java but Yes, you can make a nested class static in Java. In fact, it is even advised (see Effective Java) to prefer a nested static class in Java than normal inner classes. Now, the question comes what is a top level class and what is a nested class in Java? Well, you can declare multiple classes in a single Java source file. A class is said to be top level if it is not inside any other class and a class which is inside another class is known as nested class. You can create nested class inside another top level or another nested class in Java. This is the class which can be static in Java.

Top 20 Hibernate Interview Questions for Java J2EE Programmers

Hibernate is one of the most popular persistent frameworks in Java world. Hibernate offers object to relational (ORM) solution which frees Java developers from writing tedious, hard to read and cluttered JDBC code converting SQL columns into Object properties. Apart from freeing Java developer from writing JDBC and database interaction code, Hibernate also offers the out-of-box solution on caching, proxying and lazy loading which drastically improves the performance of your Java Web application. Given it's important in Java Web application development field Hibernate has become of one of the most sought-after skill and goes hand in hand with Spring framework. That's why Spring and Hibernate interview questions are also very popular in Java interviews, particularly for web development positions.