Question

In: Computer Science

Describe the process of writing and running a Java program, referringto the terms "run-time" and "compile-time"

Describe the process of writing and running a Java program, referringto the terms "run-time" and "compile-time"

Solutions

Expert Solution

Answer:

Intially we need to open the notepad or any editor which we are familiar with and write the program according to the syntax which is known to us and we must save it with .java notation with the classname of the program which will be stored in hard disk.Next move to run and open command prompt and compile the java program by using javac command along with the file name which will be as javac filename.java, if all the lines of the code of the program are written correct then the compiler will not show any errors and will proceed to run time but if any lines of the code misses the syntax then the compiler will throw or show the errors in command prompt which must be rectified to proceed to run time.In run time the code is executed by using java command in the command prompt along with the filename which will be as java filename which will give the desired output of the program if all the lines of the program is written correctly along with the logic otherwise it will throw the run time error which means that there is error in logic which must be resolved to get the desired output.The below is one of the example of the written and running of the java program.

class MainMethodProgram
{
   public static void main(String args[])
   {
       System.out.println("Hello world");
  
   }
}

Output :


Related Solutions

We have a list of runner and their running time, write a program in Java to...
We have a list of runner and their running time, write a program in Java to show the fastest runner and their time.
I am writing a shell program in C++, to run this program I would run it...
I am writing a shell program in C++, to run this program I would run it in terminal like the following: ./a.out "command1" "command2" using the execv function how to execute command 1 and 2 if they are stored in argv[1] and argv[2] of the main function?
The time it takes for a computer program to compile can be modeled with a Gamma...
The time it takes for a computer program to compile can be modeled with a Gamma distribution with a mean of 1 minute and a variance of 0.5 minutes^2. Find the probability that it takes more than 1 minute for a program to compile.
in C++ Compile and run the program for the following values: r = 2 Cm, h...
in C++ Compile and run the program for the following values: r = 2 Cm, h = 10 Cm. The answer should be: The cross section area of the cylinder is 3.8955634 c The side area of the cylinder is 19.474819 inch-sqr Did you get the same answer? Explain the reason for such an error and fix the problem. Modify the previous program to include a new function called total_area, that computes the total suface area of a cylinder. The...
6. Write a program in C programming (compile and run), a pseudocode, and draw a flowchart...
6. Write a program in C programming (compile and run), a pseudocode, and draw a flowchart for each of the following problems: a) Obtain three numbers from the keyboard, compute their product and display the result. b) Obtain two numbers from the keyboard, and determine and display which (if either) is the smaller of the two numbers. c) Obtain a series of positive numbers from the keyboard, and determine and display their average (with 4 decimal points). Assume that the...
Objectives To learn to code, compile, and run a program using file input and an output...
Objectives To learn to code, compile, and run a program using file input and an output file. Assignment Plan and code a program utilizing one file for input and one file for output to solve the following problem: Write a program to determine the highest number, the lowest number, their total, and the average of each line of numbers in a file. A file contains 7 numbers per line. How many lines a file contains is unknown. Note Label all...
Consider real time process for the following 3 process with the period and running time below:...
Consider real time process for the following 3 process with the period and running time below: Process Period Running time 1 80 40 2 60 25 3 39 15 Show that Rate Monotonic Scheduling will fail to schedule the 3 processes to satisfy their requirements. b. Suppose you can change the period that process 1 will take to run. What is the minimum value such that Rate Monotonic Scheduling will work? Explain your answer
UNIX/LINUX LAB (1) Review the sample shell program (tryShell.c), and compile/run the program (tryShell) with the...
UNIX/LINUX LAB (1) Review the sample shell program (tryShell.c), and compile/run the program (tryShell) with the following commands, and at the end, use CTRL+C to terminate the program: ls ls -l tryShell* date whoami hostname uname -a ctrl+C    (2) Run the program (tryShell) with "time -p" with a few commands: time -p ./tryShell (3) Edit the program (tryShell.c) so that it will exit (terminate the program) when the input command string is "exit" try shell.c code at bottom //////////// #include...
Without running the program, what happens if you run StackofStringsApp with “to be or not to...
Without running the program, what happens if you run StackofStringsApp with “to be or not to be that – is - - the question – whether tis nobler - - -“? Show how you came up with the answer (show your work). Write this on paper by hand. -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- package stackofstringsapp; /****************************************************************************** * * % more tobe.txt * to be or not to - be - * * % java FixedCapacityStackOfStrings * to be or not to - be -...
Program Specifications: You will be writing a Java program called ASCIIRabbit.java that will print the following...
Program Specifications: You will be writing a Java program called ASCIIRabbit.java that will print the following ASCII objects. There should be two blank lines between each shape and your output must match identically. Rabbit In A Hat -------------------- (^\ /^) \ V / (o o) ( (@) ) --------- | | | | | | _______ Rabbit Under A Hat -------------------- _______ | | | | | | --------- /\"/\ () * () ("")_("") Rabbit Wears A Hat ------------------ _______...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT