UrbanPro

Learn C Language from the Best Tutors

  • Affordable fees
  • 1-1 or Group class
  • Flexible Timings
  • Verified Tutors

Search in

How do I execute the Java program?

Asked by Last Modified  

Follow 4
Answer

Please enter your answer

Computer Programming Trainer & Instructor

if using command prompt - run that command java program file name ( make sure java class name and file name should be same) if using text-pad press ctrl+1 if using netbeans press run button etc.
Comments

Sr. Software Engineer at Bureau Veritas, former Sr. Software Consultant at Aptech Malviynagar

Write following command Ex: class Test { public static void main(String args) { System.out.println("Hello UrbanPro!!"); } } Save as ---------- Test.java To Compile: open command prompt where you have saved the above code D:\>javac Test.java To Run/Execute ------------------ D:\>java...
read more

Write following command 

Ex:

class Test

{

        public static void main(String[] args)

        {

                   System.out.println("Hello UrbanPro!!");

        }

}

Save as

----------

Test.java

To Compile:

open command prompt where you have saved the above code

D:\>javac Test.java

To Run/Execute

------------------

D:\>java Test

Good Luck!!

 

 

read less
Comments

Tutor | Python | Data Science | Machine Learning Trainer | Pandas | R | C | C++ | Computer Classes

javac nameofprogram.java java nameofprogram note***:Name of program should be same as that of your class name having main method *** above steps are used to execute programs on command line
Comments

Sr. Software Engineer at Bureau Veritas, former Sr. Software Consultant at Aptech Malviynagar

Suppose Following is the Code class Test { public static void main(String args) { System.out.println("Hello Java!"); } } Save this Program as: Test.java Open the Command Prompt where you have saved the program Now Type Following javac Test.java...
read more
Suppose Following is the Code class Test { public static void main(String[] args) { System.out.println("Hello Java!"); } } Save this Program as: Test.java Open the Command Prompt where you have saved the program Now Type Following javac Test.java //To Compile java Test //To Run Good Luck!! read less
Comments

Advance Excel And VBA Training

Let's say your file is in C:\mywork\ Run Command Prompt C:> cd \mywork This makes C:\mywork the current directory. C:\mywork> dir This displays the directory contents. You should see filenamehere.java among the files. C:\mywork> set path=%path%;C:\Program Files\Java\jdk1.5.0_09\bin This...
read more
Let's say your file is in C:\mywork\ Run Command Prompt C:> cd \mywork This makes C:\mywork the current directory. C:\mywork> dir This displays the directory contents. You should see filenamehere.java among the files. C:\mywork> set path=%path%;C:\Program Files\Java\jdk1.5.0_09\bin This tells the system where to find JDK programs. C:\mywork> javac filenamehere.java This runs javac.exe, the compiler. You should see nothing but the next system prompt... C:\mywork> dir javac has created the filenamehere.class file. You should see filenamehere.java and filenamehere.class among the files. C:\mywork> java filenamehere This runs the Java interpreter. You should then see your program output. If the system cannot find javac, check the set path command. If javac runs but you get errors, check your Java text. If the program compiles but you get an exception, check the spelling and capitalization in the file name and the class name and the java HelloWorld command. Java is case-sensitive! read less
Comments

Computer Teacher

In net beans or Eclipse or writing program in notepad and exhecuting in command prompt using particular commands for compile run etc
Comments

View 4 more Answers

Related Questions

Is it possible to write big safe programs in C++?
yes. C++ is generally used to write system software. For example windows operating system are writeen in C++. Most of the operating system, device driver and antivirus programs are written by using C++.
Sapna
0 0
6
How do I get C help in Ubuntu?
Use command line tool 'man'. for example 'man printf' will give you details regarding printf function C
Ashmita
0 0
5
What is a macro, and how do you use it?
A macro is a fragment of code which has been given a name. Whenever the name is used, it is replaced by the contents of the macro. There are two kinds of macros. They differ mostly in what they look...
Sandeep

Now ask question in any of the 1000+ Categories, and get Answers from Tutors and Trainers on UrbanPro.com

Ask a Question

Related Lessons

C Programming basics
C PROGRAMMING BASICS 10 Hours Introduction to ‘ C’ programming –fundamentals – structure of a ‘C’...
O

Om K.

0 0
0

C Program to print Block Letter and Small Case Alphabets using C
/* WAP to print Block Letter and Small Case Alpahbets using C*/ //Hint:use ascii code(value) to print #include#include void main(){ int i; clrscr(); //Block Letters Alphabets printf("Block Letters Alphabets\n");...

What is Safety-Critical Software?
A software whose failure may cause death or injuries to the users called Safety-Critical Software.The software present as part of Aeroplanes, or present in Rail as railway signalling software or Automotive...

Why we need to learn Programming languages?
Language is medium for communication. If two parties like to communicate or exchange the thoughts they must know a language. Language should be understandable by both the Parties. For example A wants to...

C Program-Infinite Loop[For] Demo
//Header Files #include<stdio.h>#include<conio.h> //Main function void main(){ //Function for clearing screen clrscr(); //Infinite for loop for(;;) { printf("Hello!"); } //Function for...

Recommended Articles

Brilliant Academy is one of the reputed institutes for B.Tech tuition classes. This institute is specialised in delivering quality tuition classes for B.E, Engineering - all streams and Engineering diploma courses. Incorporated in 2012, Brillant Academy is a brainchild of Mr Jagadeesh. The main motto of the academy is to...

Read full article >

Lasya Infotech is a Hyderabad based IT training institute founded in 2016 by O Venkat. Believing in his innovation, passion and persistence and with a diverse blend of experience, he started his brainchild to deliver exemplary professional courses to aspiring candidates by honing their skills. Ever since the institute envisions...

Read full article >

Information technology consultancy or Information technology consulting is a specialized field in which one can set their focus on providing advisory services to business firms on finding ways to use innovations in information technology to further their business and meet the objectives of the business. Not only does...

Read full article >

Applications engineering is a hot trend in the current IT market.  An applications engineer is responsible for designing and application of technology products relating to various aspects of computing. To accomplish this, he/she has to work collaboratively with the company’s manufacturing, marketing, sales, and customer...

Read full article >

Looking for C Language Classes?

Learn from the Best Tutors on UrbanPro

Are you a Tutor or Training Institute?

Join UrbanPro Today to find students near you
X

Looking for C Language Classes?

The best tutors for C Language Classes are on UrbanPro

  • Select the best Tutor
  • Book & Attend a Free Demo
  • Pay and start Learning

Learn C Language with the Best Tutors

The best Tutors for C Language Classes are on UrbanPro

This website uses cookies

We use cookies to improve user experience. Choose what cookies you allow us to use. You can read more about our Cookie Policy in our Privacy Policy

Accept All
Decline All

UrbanPro.com is India's largest network of most trusted tutors and institutes. Over 55 lakh students rely on UrbanPro.com, to fulfill their learning requirements across 1,000+ categories. Using UrbanPro.com, parents, and students can compare multiple Tutors and Institutes and choose the one that best suits their requirements. More than 7.5 lakh verified Tutors and Institutes are helping millions of students every day and growing their tutoring business on UrbanPro.com. Whether you are looking for a tutor to learn mathematics, a German language trainer to brush up your German language skills or an institute to upgrade your IT skills, we have got the best selection of Tutors and Training Institutes for you. Read more