












Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!













Chembur, Mumbai - 400 088
Name of Student: Roll Number : Class/DIV : Academic Year :2022 2023 Title of Experiment: EXPT 12: DISPLAY BASIC CALCULATOR USING SWITCH STATEMENT Date of Performance: Date of Submission: Program Executio n (04) Documentatio n (02) Timely Submissi on (
Viva Answ er (
Experime nt Marks (10) Teache r Signatu re
Chembur, Mumbai - 400 088
subtraction, multiplication and division based on the user input. The program takes the value of both the numbers (entered by user) and then user is asked to enter the operation (+, -, * and /), based on the input program performs the selected operation on the entered numbers using switch case. Answer the following questions in theory:
Chembur, Mumbai - 400 088
We need to calculate the sum of all the elements of an array. This can be solved by looping through the array and add the value of the element in each iteration to variable sum. Sum of all element of an array is 1+2+ 3+ 4+ 5= Answer the following questions in theory:
Chembur, Mumbai - 400 088
Name of Student: Roll Number : Class/DIV : Academic Year :2022 2023 Title of Experiment : EXPT 14: Accept and Display an entered String and execute length(),concat(),replace(),split() and trim() string methods. Date of Performance: Date of Submission: Program Executio n (04) Documentatio n (02) Timely Submissi on (
Viva Answ er (
Experime nt Marks (10) Teache r Signatu re
Chembur, Mumbai - 400 088 Name of Student: Roll Number : Class/DIV : Academic Year :2022 2023 Title of Experiment : EXPT 15: Read and Display the number as command line arguments and display the addition of them Date of Performance: Date of Submission: Program Executio n (04) Documentatio n (02) Timely Submissi on (
Viva Answ er (
Experime nt Marks (10) Teache r Signatu re
Chembur, Mumbai - 400 088
them.
The command-line arguments are passed to the program at run-time. Passing command-line arguments in a Java program is quite easy. They are stored as strings in the String array passed to the args parameter of main () method in Java. In fact command line arguments are used just for a subject purpose and maybe it is used in an advanced java core system in order to build the applications, just an expectation. Since, there may be a lot of ways to execute the program.
In this way we have performed method overloading with different numbers and different types of parameters.
Chembur, Mumbai - 400 088
constructor is called when an object of a class is created. It can be used to set initial values for object attributes:
Chembur, Mumbai - 400 088 Name of Student: Roll Number : Class/DIV : Academic Year :2022 2023 Title of Experiment :EXPT 17: Demonstrate Method Overloading Date of Performance: Date of Submission: Program Executio n (04) Documentatio n (02) Timely Submissi on (
Viva Answ er (
Experime nt Marks (10) Teache r Signatu re
Chembur, Mumbai - 400 088 Name of Student: Roll Number : Class/DIV : Academic Year :2022 2023 Title of Experiment : EXPT 18: Create thread by implementing ‘run able’ interface or creating ‘Thread Class’. Date of Performance: Date of Submission: Program Executio n (04) Documentatio n (02) Timely Submissi on (
Viva Answ er (
Experime nt Marks (10) Teache r Signatu re
Chembur, Mumbai - 400 088
at the same time. Threads can be used to perform complicated tasks in the background without interrupting the main program. There are two ways to create a thread. It can be created by extending the Thread class and overriding its run () method: Answer the following question in theory:
Chembur, Mumbai - 400 088
Applet is a special type of program that is embedded in the webpage to generate dynamic content. It runs inside the browser and works at the client side. Advantage of Applet There are many advantages of applets. They are as follows: ● It works at client side so less response time. ● Secured ● It can be executed by browsers running under many platforms, including Linux, Windows, Mac Os etc. Drawback of Applet ● Plug-in is required at client browser to execute applet. Lifecycle of Java Applet
Chembur, Mumbai - 400 088
Step 1: START Step 2: Write a java program in notepad and save it by classname.java. Step 3: Compile the java program by using command javac classname.java Step 4: Create an Html file and embed the Applet tag in the HTML file. Step 5: STOP
Create a Java Source File- Create a file named HelloWorld.java with the Java code shown here: Program: Compile the Source File- Compile the source file using the Java compiler. If compilation succeeds, the compiler creates a file named HelloWorld.class. If compilation fails, make sure you typed in and named the program exactly as shown above. Create an HTML File that Includes the Applet- Create a file named Hello.html in the same directory that contains HelloWorld.class. This HTML file should contain the following text:
Chembur, Mumbai - 400 088 Name of Student: Roll Number : Class/DIV : Academic Year :2022 2023 Title of Experiment :EXPT 20: A Program in Java to implement APPLET as a mini project in a group of maximum three students. Date of Performance: Date of Submission: Program Executio n (04) Documentatio n (02) Timely Submissi on (
Viva Answ er (
Experime nt Marks (10) Teache r Signatu re
Chembur, Mumbai - 400 088