Friday 22 August 2014

Print a String in Java

Structure of the Problem Requirements 

In this problem we will learn how to print something in command prompt in Java Program. The Program will asked user to enter something and after this display the same story on the screen. To print something on the screen we used System.out.print function in java.

Source Code

package javaapplication85;
import java.util.Scanner;

public class string_fun {
public static void main(String[] args) {
    Scanner input = new Scanner (System.in);
    String sen = "";
    System.out.println(" Enter Your Story ");
    sen = input.nextLine();
    System.out.println(" Your Story is " +sen);
   }
  }

Output of the program

Java String
Print a String in Java

Share it Please
asad

About Author!

Asad Niazi is Software Engineer , Programmer, Web Developers and a young mentor of Tech Solutions Desk and Blogging Solutions . Asad Love to writes about Technology, Programming, Blogging and make money online.

1 comments: Post Yours! Read Comment Policy!▼
Important Note:
We have Zero Tolerance to Spam. Chessy Comments and Comments with Links will be deleted immediately upon our review.