1.a) Install setup java environment
● Download or save the appropriate JDK version for windows
● Right click the computer icon on your desktop and select properties
● Click advanced system settings
● Click environment variables
● Click new
● Enter java HOME as the variable name
● Enter the path to the JDK as the variable value
● Click ok , locate path variable
● Click ok
b) Install java editor and configure workspace
Download JDK
Select version
[Windows x64 bit version]
Download now
Tool wizard
Next
Eclipse
, Java lab
Select version
Click
Download now
ok
file
new
java project [module}
give project name
finish
create
class
give class name [class]
finish
create first program
c) Execution of first java program
, Java lab
program
publicclassMyFirstJavaProgram{
publicstaticvoid main(String[]args){
System.out.println("Hello World");// prints Hello World
}
}
Output : Hello world
d) Java code execution process
● Open eclipse and click <file><new><project>
● Provide the project name and click on the finish button
● Package explorer
● Right click on the source folder select new > class from the submenuprovide class
name and click on finish
● Write program and save it
● click on the run menu 🡪output be displayed at the bottom of the screen
2) code and execute and debug programs that uses different types of
variables and datatypes
Programs
package programs;
importjava.lang.*;
publicclass employee {
intempno;
String name;
String desig;
floatsalary;
voidsetdata(inteno,Stringn,Stringd,floatsal)
{
empno=eno;
name=n;
desig=d;
salary=sal;