Sign Up to our social questions and Answers to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers to ask questions, answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
What does & lt; and & gt; refer to?
< stands for the less-than sign:
< stands for the less-than sign:
See lessHow to Import or include a JavaScript file inside another JavaScript file?
Earlier javascript was not having any feature to import and export javascript but since the discovery of ECMAScript 6 (or ES6) you can use the export or import statement in a JavaScript file to export or import variables, functions, classes, or any other entity to/from other JS files. Suppose we havRead more
Earlier javascript was not having any feature to import and export javascript but since the discovery of ECMAScript 6 (or ES6) you can use the export or import statement in a JavaScript file to export or import variables, functions, classes, or any other entity to/from other JS files.
Suppose we have two files named script.js and app.js and you want to export variables and functions script.js to app.js Then in the “script.js” file you need to write the export statement as shown in the following example:
Example :
let message = “Hi How are you doing?”;
const PI = 3.14;
function addNumbers(a, b){
return a + b;
}
// Exporting variables and functions
export { message, PI, addNumbers };
And in the “app.js” file you need to write the import statement as shown below:
import { message, PI, addNumbers } from ‘./script.js’;
console.log(message); // Prints to the console : Hi How are you doing?
See lessconsole.log(PI); // Prints to the console : 3.14
console.log(addNumbers(10, 10)); // Prints to the console : 20
How to get input in java?
In Java the Scanner class allows the user to take input from the console. It belongs to the java.util package.It is used to read the input of primitive types like int, double, long, short, float, and byte. You can use this example below to understand the way the Scanner class helps to take input froRead more
In Java the Scanner class allows the user to take input from the console. It belongs to the java.util package.It is used to read the input of primitive types like int, double, long, short, float, and byte.
You can use this example below to understand the way the Scanner class helps to take input from the user
import java.util.*;
See lessclass UserInputDemo1
{
public static void main(String[] args)
{
Scanner sc= new Scanner(System.in); //System.in is a standard input stream
System.out.print(“Enter your name: “);
String str= sc.nextLine(); //reads string
System.out.print(“Your name is : “+str);
}
}
Output :
Your name is : Sourav //In this case I have taken Input as Sourav so it is printing in the console as Your name is : Sourav