{"id":2542,"date":"2017-06-19T03:05:20","date_gmt":"2017-06-19T03:05:20","guid":{"rendered":"https:\/\/www.testingdocs.com\/questions\/?p=2542"},"modified":"2021-03-21T06:38:49","modified_gmt":"2021-03-21T06:38:49","slug":"write-a-java-program-to-output-two-lines","status":"publish","type":"post","link":"https:\/\/www.testingdocs.com\/questions\/write-a-java-program-to-output-two-lines\/","title":{"rendered":"Write a java program to output two lines"},"content":{"rendered":"<h3>Program Description<\/h3>\n<p>Write a Java to print two lines of data. We will use the <strong>System.out.println<\/strong> statement.<\/p>\n<h3>System.out.println<\/h3>\n<p>System.out.println statement prints the string and then terminates the line. The following println statement would print the data on the next line.<\/p>\n<h3>Flow chart<\/h3>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2552\" src=\"https:\/\/www.testingdocs.com\/questions\/wp-content\/uploads\/Java-Program-to-Print-two-lines.png\" alt=\"Java program Flowchart\" width=\"1123\" height=\"867\" title=\"\" srcset=\"https:\/\/www.testingdocs.com\/questions\/wp-content\/uploads\/Java-Program-to-Print-two-lines.png 1123w, https:\/\/www.testingdocs.com\/questions\/wp-content\/uploads\/Java-Program-to-Print-two-lines-300x232.png 300w, https:\/\/www.testingdocs.com\/questions\/wp-content\/uploads\/Java-Program-to-Print-two-lines-1024x791.png 1024w, https:\/\/www.testingdocs.com\/questions\/wp-content\/uploads\/Java-Program-to-Print-two-lines-768x593.png 768w\" sizes=\"auto, (max-width: 1123px) 100vw, 1123px\" \/><\/p>\n<h3>Java Program<\/h3>\n<pre>public class JavaDemo { \r\n    public static void main(String[] args) { \r\n        System.out.println(\"Welcome to TestingDocs\");\r\n        System.out.println(\"Java is an Object-oriented language\"); \r\n    } \r\n}<\/pre>\n<h3>Program Output<\/h3>\n<p>Welcome to TestingDocs<br \/>\nJava is an Object-oriented language<\/p>\n<h3>Screenshot<\/h3>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2553\" src=\"https:\/\/www.testingdocs.com\/questions\/wp-content\/uploads\/Java-Program-Output-Two-Lines.png\" alt=\"\" width=\"1688\" height=\"990\" title=\"\" srcset=\"https:\/\/www.testingdocs.com\/questions\/wp-content\/uploads\/Java-Program-Output-Two-Lines.png 1688w, https:\/\/www.testingdocs.com\/questions\/wp-content\/uploads\/Java-Program-Output-Two-Lines-300x176.png 300w, https:\/\/www.testingdocs.com\/questions\/wp-content\/uploads\/Java-Program-Output-Two-Lines-1024x601.png 1024w, https:\/\/www.testingdocs.com\/questions\/wp-content\/uploads\/Java-Program-Output-Two-Lines-768x450.png 768w, https:\/\/www.testingdocs.com\/questions\/wp-content\/uploads\/Java-Program-Output-Two-Lines-1536x901.png 1536w\" sizes=\"auto, (max-width: 1688px) 100vw, 1688px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>Java Tutorial on this website:<\/p>\n<p><strong><a href=\"https:\/\/www.testingdocs.com\/java-tutorial\/\">https:\/\/www.testingdocs.com\/java-tutorial\/<\/a><\/strong><\/p>\n<p>More information on Java can be found on the official website:<\/p>\n<p><strong><a href=\"https:\/\/www.oracle.com\/in\/java\/\" rel=\"noopener\">https:\/\/www.oracle.com\/in\/java\/<\/a><\/strong><\/p>\n<!--themify_builder_content-->\n<div id=\"themify_builder_content-2542\" data-postid=\"2542\" class=\"themify_builder_content themify_builder_content-2542 themify_builder tf_clear\">\n    <\/div>\n<!--\/themify_builder_content-->\n","protected":false},"excerpt":{"rendered":"<p>Program Description Write a Java to print two lines of data. We will use the System.out.println statement. System.out.println System.out.println statement prints the string and then terminates the line. The following println statement would print the data on the next line. Flow chart &nbsp; Java Program public class JavaDemo { public static void main(String[] args) { [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[40],"tags":[],"class_list":["post-2542","post","type-post","status-publish","format-standard","hentry","category-java","has-post-title","has-post-date","has-post-category","has-post-tag","has-post-comment","has-post-author",""],"_links":{"self":[{"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/posts\/2542","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/comments?post=2542"}],"version-history":[{"count":5,"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/posts\/2542\/revisions"}],"predecessor-version":[{"id":19737,"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/posts\/2542\/revisions\/19737"}],"wp:attachment":[{"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/media?parent=2542"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/categories?post=2542"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/tags?post=2542"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}