Using Double quote and Single quote in Java Program

Q. : Write a string including single quote and double quote in it in a simple console java program.

Sometimes, we want to use quotes in program but it is difficult to use it directly in java program. We have to use “” to insert quotes in a program. Try following program to get more idea of insert quotes in console java program.

Compatibility/Version: Java 2 Platform Standard Edition Version 1.5 (Java 2 SDK, SE v1.5.0)

Source Code:

public class Quotes
{
	public static void main(String arg[])
	{
		System.out.println("" I'm Feeling Lucky !".");
	}
}

Output:

Using Quotes in Java Program

Fig.: Using Quotes in Java Program

Download Now (.Zip File – 9KB)…

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

CommentLuv badge

Human Verification: In order to verify that you are a human and not a spam bot, please enter the answer into the following box below based on the instructions contained in the graphic.