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
Print a String in Java |
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.
Is there any easy Programmed after this one :)
ReplyDelete