File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed
Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change 1+ import java.util.*;
2+ import java.lang.*;
3+ import java.io.*;
4+
5+ public class Main
6+ {
7+ public static void main (String[] args) throws java.lang.Exception
8+ {
9+ System.out.println("hello world"); // to print on a screen
10+ System.out.print("************");
11+ System.out.println("print in same line ");
12+ // to take inputs from user
13+ Scanner sc = new Scanner(System.in); // here sc is a variable
14+ // data types
15+ int n = sc.nextInt();
16+ long m =sc.nextLong();
17+ char ch = '@';
18+ String s1 =sc.next(); //next encounters both space and enter
19+ String s2 =sc.nextLine();// nextLine encounters only enter for nextline
20+ float a =sc.nextFloat();
21+ double b =sc.nextDouble();
22+ boolean flag =sc.nextBoolean();
23+ short c= sc.nextShort();
24+ //how to concatinate the integers and strings
25+ int p = 400;
26+ int q =200;
27+ System.out.println("sum of two numbers is "+(a+b));
28+ System.out.println("this is concatination "+a+b);
29+ }
30+ }
You can’t perform that action at this time.
0 commit comments