answersLogoWhite

0


Best Answer

import java.io.*;//package defined

//class name example

public class example{

//function name declare

public static void main(String str)

{

system.out.println("welcome to java world");

}

}

to run this program :-

1.setting the environmental variables

(including path c:/jdk1.3/bin/ in existing path)

not as like that what ever the path of bin you mention,specify correctly

2.in the command prompt

type javac

it display some thing

with out any error

3.

in the command prompt

>/javac example.java

4.

>/java example

User Avatar

Wiki User

16y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

12y ago

1. Learn a programming language.

2. Get a program to compile the code into a program.

3. Enjoy the program! :D

Simple C++ hello world program:

#include <stdio.h>

int main()

{

printf("Hello world"); // This prints Hello world on the screen

return 0; // This returns the Main() function 0. When the function returns 0, it closes.

}

This answer is:
User Avatar

User Avatar

Wiki User

14y ago

//you can have just one example from me

public class Main {

public static void main(String[] args){

System.out.println("Hello, world!");

}

}

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Can I have some example java programs?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What is JNI?

Java Native Interface JNI is an interface between java and applications and libraries written in other languages. As an example, JNI enables Java programs to use C libraries and also enables C programs to use Java classes.


What are the kinds of java programs?

the two types of java programs are Applet and application programs


In order to write compile and execute java programs in my PC which software should i install?

Compilation (byte code conversion) and execution (interpretation) of JAVA programs requires a JAVA Compiler and a JAVA runtime. There are many JAVA development systems available, some free, some not free. Two vendors for the PC / Windows platform are Sun and Microsoft, but, again, there are others.


Small Java-based programs are called?

Java applets


Does java script coding mean using it for Java programs only?

Java script coding is computer coding, many things require Java, and you need to have Java enabled to view these types of programs.


What are the uses of java database connectivity?

Java Database Connectivity, a Java API that enables Java programs to execute SQL statements. This allows Java programs to interact with any SQL-compliant database.


Do you have to have java on your coumpter to run everything on your coumpter?

No; lots of programs run without Java. You only need the Java runtime to run programs specifically designed with Java technology.


Difference between java applets from java application?

Java applets are programs which we can embed in a webpage. It will act from server to client machine. But java can be used to make stand alone programs also. These programs will include games, freewares and all.


What is the providence of US?

The JRE refers to Java Runtime Environment... JRE is an implementation of the Java Virtual Machine which actually executes Java programs. Without the JRE we cannot execute our Java programs.


What are some example for string formatting in Java?

There are lots of examples of string formatting in Java. It can be difficult at times. Some of these examples are, but are not limited to; align, string, format, and JAVA.


What is the best compiler can be used to create Java programs?

A Java compiler.


What is the use of providing jre?

The JRE refers to Java Runtime Environment... JRE is an implementation of the Java Virtual Machine which actually executes Java programs. Without the JRE we cannot execute our Java programs.