Python Tutorials: Features of Python

Here is some key feature of Python language. Supports both Procedure Oriented & Object Oriented Programming features. Dynamically typed: variable type defined automatically by the assigned value. Minimalistic, Pseudocode natural language Python is interpreted language Python is interpreted language, when you runPython program an interpreter will parse Python program line by line basis, but in

How to sort array by single for loop in java

Please see below example to sort number types of arrays by using single for loop. The code should be self-explanatory. Example Code: import java.util.Arrays; public class SortArray { public static void main(String args) { int intArray = new int { 67, 6, 7,88, 1, 6,7,3, 2, 4, 5, 11, 22 }; System.out.println(“**************int Array before sorting************”); for

Python Tutorials: What is python?

In today’s programming world Python is very popular and easy to learn the language. This is general purpose programming language created by Guido Van Rossum. Python is popular because of its elegant syntax and readable code. If you are new in programming world than this is a best suited language for you. See below some

How to Sort an Array in java

Please see below example to sort different types of arrays in java. The code should be self-explanatory. Example Code: import java.util.Arrays; import java.util.Collections; public class SortArray { public static void main(String args) { int intArray = new int { 67, 43, 88, 1, 3, 2, 4, 5, 11, 22 }; String strArray = new String

How can we compare String creation performance?

In this article we will discuss performance wise what is the best way to create String object. There are two ways to create String object: By string literal String str = “10Article”; When we create string literal then JVM checks Heap string constant pool first. If the string already exists in the pool, a reference

How to reverse each word of string?

How to reverse each word of string. Problem Statement: I have a string with multiple words. I want to reverse each word of this string. Reverse each word of string. Source Code: package com; public class Test { public static void main(String args) { String str1 = "Java and J2EE Technology Servlet"; String str2 =

How to count the occurrences of a Sub String in another String?

How to count the occurrences of a Sub String in the given String > String search Problem Statements: I have a long String, I want to find out the occurrence of sub string in this. How to find out a duplicate sub string in a long String. I want to print multiple occurrence count of

How to get the nth index of the given token occurring in the given string > String search

How to get the nth index of the given token occurring in the given string > String search Problem Statements: I have a long String with multiple lines, I want to print last 2 lines from this String. I want to print second last line from my String. I want to show only three lines

JAX-WS Tutorial

JAX-WS Tutorial: As we know there is two types of web services. SOAP Restful   Here I am talking about SOAP based web services. Java provides a set of APIs to develop web services in XML format is called JAX-WS. JAX-WS provides many annotation to simplify the development and deployment for both web service clients

Java Singleton Design pattern Question & Answer

Java Singleton Design pattern Question & Answer. Q1. What is the Significance of Classloader in Singleton Pattern? Ans1. If singleton class is loaded by two classloaders, two instance of singleton class will be created, one for each classloader. Q2. What is the significance of Serialization in Singleton Pattern? Ans2.  If a singleton class is serializable,