Java, .NET, PHP, PYTHON, ANGULAR, .NET, ML, Data Scince, Testing, CI Tutorials in Easy Languages.

"Best Software Training, Internship, Project Development center of Indore India, Helpline 780506-3968"

1  Using System.in

                         java.lang
   
                         System

   PrintStream                         InputStream

  print()                                    read()
  println()

System.out.println();

out is the reference variable of PrintStream Class

System.in.read() :-

in is the reference variable of InputStream Class.

read() has two major limitation

1)  throw Exception

2)  return byte data for single char


these problem  has been solved by Scanner class because Scanner convert input data into Object pattern.

Scanner   sc = new Scanner(System.in);

this class provide predefine method to typecast data into different datatype.

int a = sc.nextInt();

float b = sc.nextFloat();

String s = sc.next();

char ch = sc.next().charAt(0);

double d = sc.nextDouble();









ASSIGNMENT:-

WAP to create Salary Calculator where basic,ta,da,comm,pf,leave,advance salary will be entered by the user .display Gross Salary and Net Salary of employee.


WAP to  reverse five digit number where first and last digit will be same .(without loop)

45123  o/p  42153


WAP to  convert temperature from Celsius to Fahrenheit ? 








       


2 Using Command Line 

Post a Comment

If you have any doubt in programming or join online classes then you can contact us by comment .

Previous Post Next Post