answersLogoWhite

0

Accept 2 no and display it in java?

Updated: 10/27/2022
User Avatar

Wiki User

12y ago

Best Answer

package scanPackage;

//Importing Scanner

import java.util.Scanner;

public class display {

public static void main(String[] args) {

//Creating scanner Object

Scanner scan = new Scanner(System.in);

//Taking first system input

String str1 = scan.nextLine();

//Taking second system input

String str2 = scan.nextLine();

//Printing both Input

System.out.println(str1);

System.out.println(str2);

}

}

User Avatar

Wiki User

12y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Accept 2 no and display it in java?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

List out the version of java?

Running "java -version" will display the current version of Java.


What is javadoc?

write a java program to display "Welcome Java" and list its execution steps.


Accept 5 numbers in an array and display it?

Accept 5 numbers in an array and display it.


Develop an algorithm to display all prime numbers from 2 to 100 Give both the pseudocode version and the flowchart version Convert your pseudocode into a Java program?

Develop an algorithm to display all prime numbers from 2 to 100. Give both the pseudocode version and the flowchart version. Convert your pseudocode into a Java program.


How do you display text with a label in java?

button.getLabel(); button.setLabel("label");


What Program that will display the even numbers in data structures and algorithms?

JAVA


How do you display two right triangles in java?

two right triangles


How do you you Create 2 text-field and 1 button in java using applet and then get the input as integers in 2 text-field and to display the output in label already created when you click the button?

How to you Create 2 text-field and 1 button in java using applet and then get the input as integers in 2 text-field and to display the output in label already created when you click the button? please send immediately,needed urgently


What command do you use to display a message in java script?

document.write("hello world")


Why does Java accept any input as string by default?

Java doesn't always accept any input as a string it only do that when the input is entered from the " JOptionPane.InputDialog" but it can accept any other data type like integer or short from the console though Scanner class .


What are Java web services used for?

Java web services are used for a means to share data between other people. Other applications use Java to display their information correctly on the web.


Write a java program to display the number is prime or not?

Simply use a for loop (i) that runs from 2 to N-1. Checking if N % i 0 then its a prime number.