Powered by Blogger.

Java Program to Print Square Pattern with Starts

>> Wednesday, August 8, 2018

This is a very basic program for beginners who starts learning for loop. This is the best example to understand how the nested loops works. In our program we are going to print the below square star (* ) pattern as shown in the image.
SquarePattern_JavabynataraJ

Read more..

How to run two Tomcat Instances on same machine

>> Thursday, February 15, 2018

Sometimes you are forced to work multiple projects at a time, using two work-spaces using IDE's like MyEclipse or Eclipse or NetBeans. In this situation you should run both the tomcat servers to test your changes at a time from your local. If you run both Tomcat servers at a time from different workspaces you will get the error message as showing below:

"Port 8080 required by Tomcat v8.0 Server at localhost is already in Use."

Tomcat Multiple Instances Error Message_JavabynataraJ

Read more..

Java - Unable to Split a String on Caret (^) symbol as a delimiter

>> Saturday, July 29, 2017

In Java Regular Expressions , Caret ( ^ ) is a Special character. Here it means "it should match the beginning" of an input.
Split method using the Caret symbol on String

Read more..

Java Program to find Perimeter of a Circle

>> Saturday, January 30, 2016

The Mathematical equation to find Perimeter or Circumference of a Circle is C=2πr. We can write hte above equation in our program as 2*Math.PI*r
In this tutorial we will learn how to calculate Perimeter(Circumference) of a Circle using java program. To write this program we are using predefined classes like Math, Scanner or BufferedReader. BufferedReader used to read the value of radius at runtime or from console.
Perimeter Of a Circle

Read more..

Java Program to Calculate Area of a Circle

The Mathematical formula to find Area of a Circle is : A= πr2 or we can write it as given below.
area = pi * radius * radius
So, to find Area of a circle we need the values of 'pi' and radius. In java we have predefined Mathematical value for pi is defined in java.lang.Math.PI = 3.141592653589793. PI is a static final value.
In our program we need to read radius value from the console by using BufferedReader or Console classes.
Calculate Area of a Circle using Java

Read more..

Can I write a Java program without main method ?

>> Thursday, August 13, 2015

Yes, We can write a java program without main method by using static block, only in java version 6. But not possible in later versions like java 7 or 8.
Before going to discuss "How to write a java program without main method", let's get an idea about the programs, which are running without main method.
Java Program without main method_JavabynataraJ

Read more..

Related Posts Plugin for WordPress, Blogger...
© javabynataraj.blogspot.com from 2009 - 2014. All rights reserved.