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

What is the difference between compile time error and run time error?
Compile error is the error when you check for syntax error while run time error comes when you do execution of the program.
Varada
0 0
6
In Java programming, what are the differences between the functions of 'int' and 'int []' when working with an array?
The may appear as part of the type at the beginning of the declaration, or as part of the declarator for a particular variable but But int a keeps type information together and is more verbose so I prefer it.
Kalpana
0 0
5
What is C language used for?
What is the C Language? The C language is a high-level, general-purpose programming language. It provides a straightforward, consistent, powerful interface for programming systems. That's why the C language...
Anil
0 0
5

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

Ask a Question

Related Lessons

Some Tricky Questions in C
Can you write two functions in which one executes before main function and other executes after the main function? #pragma startup #pragma exit Where, priority is optional integer value.For user priority...

Static and dynamic libraries
A library is a package of code that is meant to be reused by many programs. A static library (also known as an archive) consists of routines that are compiled and linked directly into your program. When...

Introduction to Programming Languages
What is a Programming Language? A programming language is a formal computer language or constructed language designed to communicate instructions to a machine, particularly a computer. Programming languages...

Variables
Variables in C Language:A variable is a name that may be used to store a data value. Unlike constant, variables are changeable, we can change value of a variable during execution of a program. A programmer...

Pointers and References
Are reference and pointers same? No. I have seen this confusion crumbling up among the student from the first day. So better clear out this confusion at thevery beginning. Pointers and reference...

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