Computer Science, asked by MrTSR, 8 hours ago

J A V A Question.
1. Write a program to execute any Windows 95 application (Like notepad, Calculator,etc)
2. Write a program to find out total memory and free memory after executing Garbage Collector(GC).

Answer only if u know!

Answers

Answered by Oreki
18

\textbf{Approach}

   \textsf{\textbf{Question - 1}}

         \textsf{Iterating over an array of application n\symbol{97}mes and }\\\textsf{running them using the \textbf{Runtime} class.}

   \textsf{\textbf{Question - 2}}

         \textsf{Filling up the memory (JVM reserved) with random data}\\\textsf{and getting the required data using the \textbf{Runtime} class.}

\text{\large Runtime class}

    \textsf{The class is used to interconnect with JRE.}\\\textsf{It provides various methods ranging from invoking the GC to obtaining}\\\textsf{free and total memory stats with available number of cores (processors).}

        \textsf{\hspace{0.5em} Some Methods}\\\texttt{\hspace{1em} void gc()}\\\texttt{\hspace{1em} void exit(int)}\\\texttt{\hspace{1em} long freeMemory()}\\\texttt{\hspace{1em} long totalMemory()}\\\texttt{\hspace{1em} Process exec(String)}\\\texttt{\hspace{1em} int availableProcessors()}\\

     \texttt{Package : java.lang}\\\texttt{Since \hspace{.5em} : JDK 1.0}

Attachments:
Answered by lilme0w
2

Answer:

1. Write a program to execute any Windows 95 application (Like notepad, Calculator,etc)

2. Write a program to find out total memory and free memory after executing Garbage Collector(GC).

Attachments:
Similar questions