Monthly Archives: November 2017

Five Best Machine Learning Libraries In Java

For finding sufficient programmers there are companies scrambling for those with good coding capability for ML and deep learning. Are you ready?

Let us see five best machine learning libraries in Java. In today’s tech world, machine learning is the hottest skill.

1) Weka :

The best machine learning library is none other than Weka which is a Java-based workbench mostly used for machine learning algorithms. For the purpose of data analysis, data mining and predictive modeling Weka is primarily used. It is very free and easy to use with a graphical interface. The main power of Weka is classification and the applications that need a classification of data can get the advantage of it but it also assists clustering, associating rule mining, time series prediction, anomaly detection, feature selection.

Read More :  How To Begin With Java Machine Learning?

2) Massive Online Analysis (MOA) :

For the purpose machine learning and data mining on data streams in real time the best software used is MOA especially for machine learning and data mining. It is developed in Java and it combines well with Weka while scaling to demanding problems. For the purpose of regression MOA’s collection of machine learning algorithms and tools for evaluation are used. For large evolving data sets the best useful tool is MOA and data streams along with the data produced by the devices of the Internet of Things.

It is best designed for machine learning in real time based on data streams. Memory-efficient processing and time are best suited for its aim. For running experiments, MOA offers a benchmark framework in the data mining field by offering various useful features like an easily extendable framework for new algorithms, evaluation methods, streams, for repeatable experiments.

3) Deeplearning4 :

Java system is contributed in the best way by Deeplearning4j and it is an open source distributed commercial grade library in Java and Scala developed by Skymind. Deep reinforcement and deep neural networks are brought by this mission and deep reinforcement learning together for business environments. Pattern recognition and goal-oriented machine learning are the capabilities of deep neural networks and deep reinforcement learning.

Read More :  Best Tips For Safe java Programming


Andrew McCallum developed this tool which is an open source java machine learning toolkit for language to text. Statistical natural language processing, document classification, clustering, information extraction, topic modeling and other machine learning applications which is backed by a Java-based package. There are lots of algorithms and code for evaluating classifier performance supported by MALLET.

5) ELKI :

ELKI stands for Environment for Developing KDD-Applications Supported by Index-Structures is Java’s open-sourced data mining software. The main focus of ELKI is in research algorithms with cluster analysis, outlier detection, database indexes, etc. An independent evaluation of data mining algorithms and data management tasks are separated by ELKI. There are other data mining frameworks like Rapidminer or Weta but this feature is unique among them. Arbitrary data types are also allowed by ELKI distance or file formats or similarity measures.

Don't be shellfish...Email this to someonePrint this pageTweet about this on TwitterShare on StumbleUponShare on TumblrShare on LinkedInShare on RedditDigg thisShare on Google+Pin on PinterestShare on FacebookBuffer this page

Explain The OOPs Concept In Java

Definition of OOPs Concepts in Java

The main reason behind Java’s Object Oriented Programming is the concept of OOPs. They are an inheritance, abstraction, encapsulation, and polymorphism. You can understand the working of Java by getting to know about the above terms. It is fully safe and secured and creates working methods and variables and is reusable.

List of OOPs Concepts in Java

Here are four main OOPs concepts in Java. They are:


Complexity is represented in a simple way by means of Abstraction. There are some simple things like classes, objects, and variables for representing more complex code and data in Java.


Fields are kept inside a class private then access is provided to them with the help of public methods. For keeping the data and code safe inside the class, it is a secured barrier and this is the way for re-using objects like variables or components without permitting open access globally.

Why Java Doesn’t Support Multiple Inheritance


This is an important feature of Object Oriented Programming in Java and new classes are created by the programmers for sharing few attributes of present classes.


The same word can be used by the programmers in JAVA OOPS concept and it has different meanings in different contexts. In Java, one form of polymorphism is method overloading. Here is where different meanings are implied by the code itself. Method overriding is another form. Here is where the values of the supplied variables imply different meanings.

How OOPs Concepts in Java Work

The components are created by the programmers and it can be reused in various ways but still, it will remain secured and the si the working of OOPs concept in Java.

How Abstraction Works

Useful, reusable tools are created by programmers with the concept of abstraction in Java. There are several ways in which an object can be created by the programmer. Data structures, variables, functions are few ways. Different classes of objects can also be created by the programmers. For defining the objects these are ways.

A class of variable might be an address for specifying each address object that has street, name, city and zip code.

Top 13 Oops Java Interview Questions

How Encapsulation Works

Without comprising the security, you can re-use the code with the help of encapsulation. It saves a lot of time and is a wonderful tool for OOPs concept. For instance, a piece of code may be created for calling specific data from a database. For reusing the code with other processes or databases it may be useful. Our original data is kept private at the same time it can be changed without breaking it for others who chose it in the meantime.

How Inheritance Works

There is another easy going Java OOPs concept called Inheritance and it works by one class using the properties of the other. The subclass is called as the inheriting class or a child class. The class from which it inherits is called the parent class. If a new class inherits the properties from an old class the extends keyword is used.

How Polymorphism Works

With the help of a reference to the parent class, the working of Polymorphism in Java happens and this affects the child class object. If you are creating a class called parrot by extending the bird class and this class might implement bird show class. Here the parrot class becomes polymorphic as it inherits the attributes of both the bird show class and the bird class.

What is Polymorphism in Java?

Single Responsibility: This is the best practice in Java and in the layman context it can be said that a class should have only one functionality. Thus it can be invoked on its own without any difficulty due to coupling.

Open Closed Design: All the methods and classes can be made which is closed for modification but is open for extension The code which is tried and tested can remain static and can be modified for doing new tasks as per the requirement.

Don't be shellfish...Email this to someonePrint this pageTweet about this on TwitterShare on StumbleUponShare on TumblrShare on LinkedInShare on RedditDigg thisShare on Google+Pin on PinterestShare on FacebookBuffer this page

What Are JDBC Drivers And Explain Its Types?

JDBC API and database do not communicate directly and JDBC driver of the database is used for communication with the database. A software component offered along with the database is none other than JDBC driver which is needed by the JDBC API for communicating with the database. There is an individual JDBC driver for each database.

Implementations of interfaces offered in the JDBC API are none other than the JDBC drivers for a specific database. In a JAR file, these implementations are bundled and provided along with the database. For interacting with the database these implementations are used by the JDBC API for interaction.

Types Of JDBC Drivers :

There are 4 types of JDBC drivers. They are,

1) Type 1 JDBC Driver / JDBC-ODBC Bridge Driver

2) Type 2 JDBC Driver / Native API Driver

3) Type 3 JDBC Driver / Network Protocol Driver

4) Type 4 JDBC Driver / Native Protocol Driver

Read More :  Do you know about JDBC?

1) Type 1 JDBC Driver / JDBC-ODBC Bridge Driver :

The name JDBC-ODBC Bridge Drivers has been adapted from the work it does, that is, it acts as a bridge between JDBC and ODBC API. All JDBC calls are translated by this type of drivers into ODBC calls and it sends them back to the ODBC driver for communicating with the database. They are the slowest types of drivers. They take lots of time because JDBC calls go to ODBC driver through the bridge and then given to database. For high profile applications, these kinds of drivers are not suggested. They are not completely written in Java and it also leads to portability issues.

2) Type 2 JDBC Driver / Native API Driver :

All JDBC method calls are translated by this Type 2 JDBC Driver into database-specific calls using native API of the database. As there is a reduction in the communication layer in this driver it has a better performance when compared to Type 1. They are not completely written in Java similar to type 1. This leads to portability issues. They are also database specific. There is a need to change the driver when you change from database to database. This is the biggest drawback of this driver.

Read More :  Frequently Asked JDBC Interview Questions And Answers

3) Type 3 JDBC Drivers / Network Protocol Driver :

The application server or middleware use the type 3 JDBC Drivers for translating all JDBC calls into database-specific calls. The prime advantage for this driver is it is written in Java language. Thus there are no portability matters over here. Middleware component or extra application server has to be maintained and it requires more money as an extra application server.

4) Type 4 JDBC Drivers / Native Protocol Drivers :

Thin Driver is the Type 4 JDBC Driver for converting JDBC calls into database-specific calls. This famous driver is quite suggested when compared to Type 3 as it communicates faster than Type 3 JDBC Driver and removes the extra layer of communication. Similar to Type 3 JDBC Driver it is very much written in Java language and therefore it is portable.

Don't be shellfish...Email this to someonePrint this pageTweet about this on TwitterShare on StumbleUponShare on TumblrShare on LinkedInShare on RedditDigg thisShare on Google+Pin on PinterestShare on FacebookBuffer this page

6 Points That Prove The Importance Of String In Java

Sun Microsystems developed and released Java, a programming language in the year 1995. There are lots of application and websites that we use or see are developed using Java language.

Significance of string in Java Programming Language

Most of the Java programmers use String very frequently and they are very crucial in Java. It is significant that a good knowledge of String class is necessary for Java developers so that they can use them effectively. Here are few significant topics about Java String:

1. No null character used for termination.

There is no need for using a null character by String for the purpose of termination. On the other hand, objects and strings are supported by character array. For representing a string in a language programmers can use a character array. This can be done using toCharArray() method of java.lang.String class of JDK.

2 Strings are not changeable

Most of the Java programmers must be aware of the fact that Strings cannot be modified and it means once the string is created by the programmer it cannot be changed. Still, if the programmer persists to change the content of the string it will lead to the creation of a new string. On the other words, there is no permission granted for adding new content into the existing string and even the functionality of a string cannot be overridden.

Do you know the Concept of Java String?

3. String Pool contains the strings

There is a separate string pool in the strings and inside the Java memory, the string pool is a special memory located. With the help of String literal if the string object is created by the programmer the string pool is not checked by the JVM for creating an object using the new operator.

4. Comparison of Strings is done using equals method

Equality method is not used for comparison of two strings rather equals() method is used by the String class. The content equality is offered by the string class as it overrides the equals method which basically has characters, order, and case, in use.

5. Retrieving part of String in Java

Substring() is used for retrieving only a portion of String in Java by the Java programmers. Start and end index is specified by the programmers and it returns character from the specified range. With the help of character arrays substring(), methods are also backed and it is also used by an original string.

Difference Between StringBuilder And StringBuffer In Java

6. Strings Assists Operator Overloading

Although operator overloading concept is not assisted by Java programming language most of the special programmers can use the operator overloading method. For combining two strings + operator can be used by the Java programmers. For converting char, int, long or double to convert char, int, long or double to transform into String by simply combining with an empty string “”.


In Java, strings are quite important and the content inside the string cannot be overridden or changed after creation. There are various other functionalities supported by strings and they can be used by programmers according to their project need.

Don't be shellfish...Email this to someonePrint this pageTweet about this on TwitterShare on StumbleUponShare on TumblrShare on LinkedInShare on RedditDigg thisShare on Google+Pin on PinterestShare on FacebookBuffer this page

Explain Java JVM Run Time Data Areas

It is very important to understand Java programming but for that Java Virtual Machine, runtime data areas are needed to understand as a prerequisite. OutOfMemoryError is one of the most dreaded errors in Java and is associated with Java Virtual Machine (JVM) memory areas. JVM internals is also very important to know along with the working of a data area and with the help of this we can track the JVM errors.

1) Program Counter (PC) Register :

The program counter (PC) helps in recording the current instruction execution at any moment. In a sequence of instructions in a program, it is called as a pointer to the current instruction. It is the same in Java JVM terms. As Java assists multithreading, the architecture is multithreaded and thus when a thread is created a program counter is created. The current statement executed in the thread is executed by the PC counter.

Ream More :  Multithreading in Java

2) Java Virtual Machine Stacks :

For storing Java virtual machine frames, Java stacks are used. The stacks do not have any changes done by JVM and they are just storage units for frames. There are two types of stack memory they are a varying size and fixed size. With respect to the requirement, varying size can expand dynamically. When a method is invoked, JVM frames are created and dynamic linking is performed.

Varying size can dynamically expand as per the need. Java JVM frames are created when a method is invoked and it performs the dynamic linking.

3. Heap Memory :

For storing objects of arrays and classes, heap data area is used. Across multiple threads, heap memory is common and shared. Garbage collector comes to the rescue over here. At VM startup heap data area is created. This helps in claiming the memory back by the garbage collector. It is regarded as the best feature of Java.

Read More :  Garbage Collectors In Java and It’s Types

4. Method Area :

There is a logical part of heap area called method area but JVM implementers decide about it. There are per class structures and fields in the method class. It consists of method data, method and constructor code, run-time constant pool. At JVM startup, a method is created and shared among other threads. If the memory space is not enough during the run-time then JVM will throw OutofMemoryError.

5. Run-time Constant Pool :

Outside of the method area, a run-time constant pool is created and it is done by JVM when an interface or class is created. The constant pool table has the Run-time constant pool which is the best suited for a single class or interface. If the JVM cannot find the memory for run-time constant pool allocation it will throw OutOfMemoryError.

Read More :  Understanding JVM Internal

6. Native Method Stacks :

There are native method stacks available in the native methods supported by JVM. If JVM cannot be loaded with the help of native methods then there is no need of native method stacks. Similar to general JVM stacks, memory size is managed. StackOverflowError is thrown by JVM or OutofMemoryError will be popped up respectively.

Don't be shellfish...Email this to someonePrint this pageTweet about this on TwitterShare on StumbleUponShare on TumblrShare on LinkedInShare on RedditDigg thisShare on Google+Pin on PinterestShare on FacebookBuffer this page

Explain Java NIO BUFFER

For writing to a channel or reading from a channel, buffer is regarded as a block of data. For holding the data and acting as a destination point in an NIO channel, this object is used. For accessing data and tracking the read and write processes there is a formal mechanism offered by buffer. The only major difference between old Java I/O and NIO is buffer. Earlier versions had direct reading of data from s tream or written into it but now buffer is used for reading or writing it.

NIO Buffer Characteristics

  • The basic building blocks of Java NIO is buffer

  • For reading and writing data buffer offers a fixed size container.

  • Most of the buffers are readable but only few buffers are writable.

  • The final destination of channels are buffers.

  • Buffer content is not quite mutable in read-only format but its position, mark, and limit are mutable.

  • They are not thread-safe.

Difference Between StringBuilder And StringBuffer In Java

Buffer Types

For every primitive type there is a buffer type and all the buffer classes apply the Buffer interface. Here are few buffer types available in Java NIO package:

  • ByteBuffer

  • CharBuffer

  • ShortBuffer

  • IntBuffer

  • LongBuffer

  • FloatBuffer

  • DoubleBuffer

  • MappedByteBuffer

Buffer Capacity

You can store only a limited amount of data in Buffer as it is a fixed size type. The capacity of the buffer is defined by the maximum fixed size. Before writing into the buffer it should be check whether it is full and if it is full it should be cleared. The capacity can be set only for once and it cannot be changed ever.

Buffer Limit

The capacity of the buffer is equal to the limit especially on the write mode. The limit in the read mode is one previous to the last filled index. While writing the buffer, the limit is incrementing.

0 <= limit <= capacity.

Buffer Position

Current location in buffer is identified by the position of the buffer. At the time of buffer creation, zero is the position. The position is incremented to the next index on write or read.

Best Tips For Safe java Programming

Buffer Mark

Bookmark and Mark are similar for setting the position of a buffer. Current position is recorded when mark() is called and marked position is restored when reset() is called.

Buffer flip, clear and rewind

Buffer flip()

To make a buffer flip () method is used especially for get operations and a new sequence of write is made ready. The limit is set to the current position and then to zero by by the flip () method.

Buffer clear()

To make a buffer for put operation and clearing the space to be available for new sequence to read Clear() method is used. The limit is set by the clear method and position to zero.

Buffer rewind()

The data that is existing is read again by the rewind() method and the rewind() method is used for setting the buffer position to zero.

Don't be shellfish...Email this to someonePrint this pageTweet about this on TwitterShare on StumbleUponShare on TumblrShare on LinkedInShare on RedditDigg thisShare on Google+Pin on PinterestShare on FacebookBuffer this page

10 Tips To Become A Better Programmer

To be a better programmer you must be better at algorithms, designing using OOPS, data structure, multi-threading and lots of other programming concepts eg: divide and conquer, recursion, prototyping, and unit testing. You can find a mixture of lots of skills in programming and it means it is not practical to learn it in quick time, but it takes lots of time to get it with experience but is not a one night process.

It is possible to be a Java programmer with 5 years of work experience but without being a proficient professional. Most of the candidates are targeting on Java theory for an interview instead of programming and coding skills. Here are few things to help you become a successful Java programmer.

1) Coding, coding, and coding :

It is very tough and the main thing of programming. With the help of coding, you can get to know the errors and handle it well and focus on improving them. It is not possible to just focus on designing as coding is very much important to produce output. Just don’t quit after solving the problem because they keep coming again and again.

Read More :  Best Tips For Safe java Programming

2) Go through the books :

As said coding is quite difficult and both good code and the bad code has a major difference but how are you aware of it? It is not possible to understand the difference until you have come across a good code and understand why a code is particularly good. Here is where books come into the picture.

3) Explore Open Source :

With respect to Google, Apache and other projects just participate in the open source code to develop your skills in programming and become a very good programmer. All you need to do is register on their mail list. Rest will be sorted out because you will dwell in the discussion between good programmers and therefore you will be able to understand problem and approach to develop the skills in you.

4) Work more on Algorithms, data structure, and design related problems :

This is very much important to become a very good programmer. You can find lots of programmers are expert in algorithms, data structures, and basics. For any program the key basis is a data structure, learning more about them helps in problem-solving.

Read More :  Why Is Java Considered A Secured Language?

5) Get connected with good blogs “

It is similar to reading books and yes it does helps you. Most of the programmers generate such blogs and they give away their personal opinion. It is very easy to understand. They also help you in knowing new features, technology, and API.

6) Reading Code :

It is not just about reading blogs but you need to read codes too. As said earlier reading blog is easy but going through code is quite tough. Just keep viewing various codes different programmers in the forum. Develop your skill, and understand the concept and at first, it will be very difficult to bug the program and understand the code but practice will make you perfect.

7) Writing Unit Test :

Coding process can be understood and groomed with the help of unit test and finally, it will help you to design better. Most of the thing which is tough enough to test but has a great chance of improvement. You can find better abstraction, names, interface, and abstract class design with the help of writing unit test. For average programmers unit test is a tough task but then this is the only way to develop your skills.

8) Review your code :

This method is also very important to become a good solid programmer after unit testing. This helps in two ways for both the author and the reviewer to enhance his code sense and gives advice while author gets to know from his mistake. Code review helps in identifying your mistakes and gain experience in becoming a good programmer.

Read More :  Introduction To Robotics : Programming A Robot Using Java!

9) Converse with the fellow programmer :

With respect to talking, reading is very much low energy event. It is always good to connect with a fellow programmer and talking and hearing will help you more when compared to just reading. Most of the programmers indulge in talking with the fellow programmers to groom their skills.

10) Be a part of forums and commenting the blogs :

For updating your skill this activity is very much important. With the help of sharing knowledge the first person who gets the advantage is the one who is open and active. It is a vast field which left unused will make you forget important things. Sharing is the best way to improve your knowledge.

Don't be shellfish...Email this to someonePrint this pageTweet about this on TwitterShare on StumbleUponShare on TumblrShare on LinkedInShare on RedditDigg thisShare on Google+Pin on PinterestShare on FacebookBuffer this page