10 Things About String Every Java Programmer Should Know

A special class in Java which is most frequently used is called as String. You can find various things to understand about String in Java when compared to any other class and it is very important to have a good knowledge of various String functionalities for using it properly.

1) Strings do not have null termination in Java

There is a String termination in both C and C++ but it is not the case with Java. In Java, Strings are referred to as an object and is supported by character array. The character array can be retrieved by representing String in Java by calling the toCharArray() method of java.lang.String class of JDK.

2) In Java, Strings are both immutable and final

In Java, Strings are immutable which implies that after creating the string’s content cannot be changed. If at all you use toLowerCase(), toUpperCase() then a new String is created.

3) In a String Pool, Strings are kept

In Java, String is considered as a Special class and in a separate pool, all the String literals are maintained with special memory location inside Java memory more aptly inside PermGen Space. If a new string is created using String literal then the String pool is checked by JVM and if there is a similar object then you cannot create a new object.

Introduction Java String

4) Strings can be compared in Java using equal methods.

The equals method is overridden by String class and it offers a content equality and characters, order and case are the basis for it. You can use equals() to identify whether two string objects are same or not instead of equality operator.

5) lastIndexOf() and IndexOf() are used or matches(String regex) method to search inside String

A convenient method is offered by Java in String class to check if a sub-string or character or a pattern is present in a current String object. The position of character or String will be returned with the use of indexOf( ) if that is present in current String object or -1 and character is not present in String. The methodology of lastIndexOf is the same but it checks from an end.String.match(String regex) is more powerful which permits you to search for a regular expression pattern within the String.

6) To get part of String in Java, Use Substring

Another method is offered by Java String called substring () and it is used for getting parts of String. Start and end index and substring() method must be specified by returning character from the range. From 0, the index starts and continues till String.length()-1. Here the character array backs up the substring.

Do you know the Concept of Java String?

7) + is overloaded for String concatenation

Operator Overloading is not assisted by Java but String is special and + operator can be used to combine two Strings. Int, char, long, or double can be converted with the help of this into String by simply concatenating with empty string “”. With the help of StringBuffer + is internally implemented prior to Java 5 and StringBuilder from Java 5.

8) White spaces from the String will be removed using trim()

From both the ends of the String, trim() method can be used to remove the white spaces in Java Strings. If white spaces are removed with the help of trim() then a new String is returned or else it returns same String. Replace() and replaceAll() methods are also provided by String to replace the characters from String.

6 Points That Prove The Importance Of String In Java

9) With the help of Regular expression split(), methods can be used for splitting String

There are lots of features present in String in Java and it has methods like split(regex) and any String in form can be taken and it can be split too. It is quite useful if you are working on comma separated file (CSV).

10) Sensitive data cannot be stored in a String

Sensitive data like passwords, SSN always gives a threat in String. You cannot remove contents of String because String is immutable in Java and there is a longer duration of their stay in Java heap as they are kept in String pool.

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

5 Reasons Why You Want To Learn Mainframe Programming

If you want to become a very good developer then you need to keep in touch with the industry track whether it is Spark, Docker or kendo. Your market value is increased by staying on the cutting edge by enhancing your market value and keep giving gifts to your work and assists you to ignore the blunder of complacency.

1) Enterprise applications are mainframe applications : 

The core business logic and data are present at the world’s biggest enterprise as the primary repository. In any big enterprise, the most significant application purchase the mainframe resources on the rear end and on the front end they are mobile or web or cloud.

The mainframe applications and databases can be best purchased without any contact with them and enterprises can be agile digitally by using agile everywhere and this is the greatest misunderstanding.

You are going to experience a twitch at the rear end for maintaining the balance in the competition especially if mainframe application and data are used at the back end.

There is a need for change although small in the Cobol application logic. Some DB2 database calls are to be coded. Some platform behaviors are to be adjusted to maintain performance SLAs for scaling back-end workloads in step with increasing front-end mobile/web demand.

Read More : Java Is A Dead-End For Enterprise App Development

2) The arrival of agile mainframe processes and tools :

Earlier there was a time when the rapid increase in mainframe development was a difficult task. And arcane green screen tools are worked exclusively by the Mainframe Developers which was an enterprise achieved by hard work on both the tools of the IBM z/Os platform.

Therefore the only way to be on the competition irrespective of tooling and platform knowledge issues is to dedicate yourself completely which implies to cut off ties with all the cloud, mobile or other technology of your interest.

It is not the same anymore. Mainframe DevOps tools now from the main new generation offers the similar graphical look and get the right plugin for an Eclipse IDE.

Built-in intelligence is offered by these new mainframe tools that insulate the developers from PL/I, Cobol, DB2, Assembler, CICS, etc.

Read More :  Java Oracle devops

3) The best-engineered platform :

The understanding of mainframe platform is very poor who understands it through myth and rumor. There are lots of mindblowing works of engineering in the IBM mainframes. There are more than 1.15 million CICS executed by the enterprise mainframes around the world collectively that is equivalent to various Google Searches, Facebook likes, YouTube views and Twitter tweets.

From an economic point of view, there is extreme efficiency in Mainframes. Additional workloads often produce extra incremental costs in the distributed and cloud environments, which consists of infrastructure and staff. It will cost you more in the cloud.

There is a need for optimal security, mega scale, and screaming performance for the use cases and this is the biggest challenge among the developers.

4) Keeping the goals high :

Finances are not the only thing that drives you even if you are a programmer. There is a need for sense and goal in your work. There is no other work like mainframe development which is more mission-driven. Data and mainframe applications offer the foundation for the global economy. For enterprise mainframe development few jobs can look at the magnitude. Global retail, global banking, global insurance all rely on it similar to air travel. To make it easily understandable, if there is a need for having the best positive impact on every line of code on the greatest number of people then the right choice is mainframe development.

Read More :  3 developer pattern trends of Java in 2016

5) The supply and demand monetary value :

It is a familiar fact that mission is everything to drive you but then money for developers are also equally significant who gain knowledge in mainframe programming. The mainframe developers of the complete professional era are right now stepping back because of its retirement. There is a great demand for mainframe development similarly to push up due to the above-mentioned requirement to assist cross applications with a higher frequency of updates to DB2, Cobol, Assembler and various other resources running on IBM z/OS.

This gap in skill has to be filled in some way or the other by the big enterprises. Mainframe-only developers are not required to do so as the development of mainframe can be done in the cross-platform application.

For agile mainframe DevOps skills, large enterprises are required to meet their needs by gaining knowledge of mainframe among their in-house IT staffs and by recruiting contractors with good cross-platform skills that have functional literacy with mainframe DevOps tools.

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 Access And Non-Access Modifiers In Java?

Two types of modifiers are offered by Java. They are: Access modifiers and Non-Access modifiers. The visibility is controlled by access modifiers for using a class or a variable or a method or a constructor. Functionalities are offered by non-access modifiers like synchronizing a method or block.

Access Modifiers In Java :

The visibility of a class or method or a variable or a constructor can be controlled with the help of access modifiers. In Java, there are four different access modifiers in Java.

1) Private:

There is no permission for methods or objects outside the class which is declared private irrespective of a field or a method or a constructor. Even subclass cannot be inherited by private members.

2) Default:

if there is no access specifier defined then it is considered default and they are visible inside the package. And only subclasses are inherited by them. This implies they are not inherited and visible outside the package.

3) Public:

Almost everywhere public members are visible and they are inherited to any subclass.

Read More :  3 Different Modifiers in Java

4) Protected:

The characteristics of public members and default members together combine and are present in protected members it implies that protected members are implied inside the package like default members and they will be inherited by any subclass similar to public members.

Non-Access Modifiers In Java :

There are few other non-access modifiers in Java to offer the functionalities other than visibility. Such modifiers are named as Non-Access Modifiers. There are lots of non-access modifiers present in Java. Here are few non-access modifiers mentioned below:

1) Static:

The static members are declared as common to all instances of a class. Class level members and static members are the same which are stored in the class memory.

2) Final:

A variable or a method or a class cannot be changed after using this modifier. After a variable has been declared to a final variable it cannot be modified. You can override a final method into the subclass and a subclass cannot be created to a final class.

Read More :  An overview of Java Access Modifiers

3) Abstract:

Either by a class or with a method the modifier can be used. This modifier cannot be applied to variable and constructor. An abstract method must be modified in the subclass. If a class which is declared cannot be instantiated.

4) Synchronized:

A particular method’s or a block with multiple threads access can be controlled only with the help of this modifier. If a block or method is declared synchronized then it will permit only a single thread.

5) Transient:

In serialization process, this modifier is used. A transient variable cannot be serialized during the object serialization.

6) Volatile:

In multi-threaded programming volatile modifier is used. If a field is declared volatile then its value must be read from the main method and not its own stack and this signal is given to the threads.

Read More :  Java program structure

7) Strictfp:

For the purpose of floating-point calculations this modifier is used. On every platform, the same floating point presentation will be given with the help of this keyword. Floating point variable is made more consistent across various platforms with the help of this modifier.

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

The Traits Of A Good Programmer

Programmers are not boring irrespective of the stereotypes and lots of work demand they have a good social life too. Coders are basically from various background. Here are few personality traits that you need to inculcate:

1) Patience

Any programmer must have patience because the working hours will be very much longer. Irrespective of the language or programming area you need to be consistent with your hard work. Even though you might be a successful manager, you will need to face work pressure. Just be cool and calm and face the problem that is where your patience level lies.

2) Creativity

It is not just related to designers, writers, or artists but coders too come into the picture. By creativity, it does not mean a song, painting or a story but you’re creating a new function. Definitely, there are few ways of solving a programming task and all you need to do is check out the solution. Therefore it is quite significant to be creative and visualize the results.

10 Tips To Become A Better Programmer

3) Logic

You need to have a good logical thinking if you want to become a good programmer being creative alone is not enough. It is a familiar fact that coding means logical thinking which is working properly. The best way to finding a workable solution is to split a programming down into small logical elements

4) Curiosity

You will get to know the fact that tech industry is frequently changing on a fast basis. You will get to know about the frequent changes only by having a good level of curiosity. You can learn more if you have a good natural inquisitive drive and only then you can become a good programmer. This will let you. The programmers must have the ability to learn good concepts and must have a broad-minded approach.

5) Passion

For being successful in any job you must have passion towards it. If you have passion then you will be unstoppable irrespective of any amount of problem. This will make you the best programmer. If you are not aware of the reason why there is a need to become a programmer or why you want to code implies that you are not passionate towards programming.

Best Tips For Safe java Programming

6) Introversion

It is not mandatory that you need to be an introvert for being a successful programmer. You can socialize too but then remember that work while you work and play while you play. At times you also need to work alone sitting in front of a computer. Thus most of the programmers would be an introvert.

7) Conscientiousness

You need to be very alert to understand the significant aspects of programming. You need to understand that you should be the best coder and for that, you should go through each line of code because a single typo will make the entire program to collapse. Thus it is very important for your programming career.

Which Is The Best To Choose -JAVA vs .NET?

8) Humility

Most of the programmers are quite independent and have their own style executing their work in their office. You may be intelligent or you have more knowledge but then don’t show it off to others in the company be humble and get to know about others too. That is how you grow.

9) Adaptability

Being a successful programmer you need to be quite adaptable and you should not be rigid enough because no things go as per the plan, therefore, you need to change according to the requirements to be the best programmer.

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

Which Is The Best To Choose -JAVA vs .NET?

For developing and executing applications on Windows Client and server operating systems Microcsoft. NET framework is used on Windows Client and server operating systems. For creating and running applications on the Windows platform there are features and functionality offered by it. There are five components of Microsoft .Net Platform and they are Windows Enterprise Servers, Windows Operating system, .Net Framework, Visual Studio. Net tool set etc. Here are the three components of . Net Framework they are Framework Class Library, Common Language Runtime (CLR) and ASP.NET.


This program is actually created by the Sun Microsystems and refers to a set of programs and standards and now bought by Oracle Corporation. These are the following points when people talk about Java:

Java compiler and other utilities are present in the Java Development Kit and Java Virtual Machine is present in the Java Runtime Environment.

You can find lots of Application Programming Interfaces in the Java Class Libraries which is a large body of reusable code and functions that would be given by the operating system.

The developers can create the application with Java Programming language.

Read More:- Java Programming Course Vs .NET Programming Course: Which is Better?

Java Runtime

The code developed by the developer is translated by the Java compiler which is a part of Java Development Kit (JDK) into a standalone Java bytecode. Understandable instructions are the result of translating the Java bytecode with the help of Java Virtual Machine (JVM). If the JVM and Java Class libraries are present on a computer the machine is supposed to have the Java Runtime Environment (JRE).

Similarities Between .NET and Java

The development of the application is aimed to simplify both .Net and Java by offering a set of modular components, services, and a set of standardizing. With the help of standard services and components at their disposal developers can focus on business requirements other than programming lots of fundamental services.

Similar Computing technologies, multi-tiered

For enabling programmers to build tiered web applications Java and .Net both were developed. Client tier, Server tier, and database tier are present in the three-tiered application. For facilitating transactions both Java and .Net offer services in which business processes can be data recorded and triggered in databases.

Read More:- Which is preferable Java, .Net or PHP?

Enterprise Level Development

The same goal of enterprise application development is achieved by both and they also provide different tools. C# (primary language of . NET) and Java both are adopted from C and C++. You can find both the platforms like type-safe, object-oriented, and have automatic garbage collection. The best ability to develop and integrate web services are offered by both Java and .Net and thus making the applications more interoperable and extensible. Apart from that both .NET and Java/JEE have a set of services and components and there are various features of performing tasks like scripting Web pages, accessing a database, handling messages and linking remote sources.

Differences between .NET and Java

There are lots of differences in the frameworks and their interior workings and there are few aspects of the languages that come with them. Here are few differences that you need to know:

Windows vs. Multi-Platform:

The main focus of Microsoft .NET is on windows operating system irrespective of open source implementations of Microsoft’s .NET Framework similar to mono for creating cross-platform applications. Depending on the idea that same software should be present on various different kinds of consumer gadgets, computers and other devices on a network are done with Java. For every individual platform, Java applications run on virtual machines.

Read more:- How come Node.js overtakes Java and .Net?

Proprietary vs. Open source:

A strong and free product which is none other than .NET Framework and is created by Microsoft and combined into the Windows Operating System. For offering implementation, there are no third-party vendors irrespective of being highly extensible and lots of third-party additions are available.

There are lots of vendors who support Java and the main focus is on Oracle JDK and JRE. There is a need for lots of tools, products, and applications and that is one of the major strength of Java. The pumping force for innovating something is because of the healthy competition among Java EE vendors with the help of strict compatibility standards. There are some open source counterparts along with proprietary and commercial products. For all .NET innovation, Microsoft users depend on Microsoft

There is a standard development IDE present with Microsoft Visual Studio for .NET. There are various tools that a developer needs like debug, develop, build and deploy various applications for the .Net Framework is present in this tool. Eclipse, IntelliJ Idea, Oracle NetBeans, and Oracle JDeveloper are the four main IDEs of Java. Rather than just sticking to a single environment on the single platform your needs can be chosen easily and freely at various price points and select to use Mac OS X, Linux, or some other platform which is assisted by JDK but there is no standard tool that is present.

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

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