You are here:   HomeJava Programming
by Dinesh Thakur Category: Introduction to Java

Our first program is composed of three logical parts :

1. Definition of the class;
2. Definition of the method main ();
3. Content of the method main ().

 
by Dinesh Thakur Category: Introduction to Java

The first step of compiling and running a Java program is to write the text of your program in a document and save it on the hard drive. This document is called a source file, and you must name it with a .java extension. Next, compile this program using a Java compiler. The compiler checks the program for errors and, if no errors are found, it generates a new document containing Java bytecode. This document is called a class file, and its name ends with a .class extension.



 
by Dinesh Thakur Category: Introduction to Java

The RMI architecture, shown in Figure, describes how remote objects behave and how parameters are passed between remote methods. Remote method invocation allows the program to define separately the behaviour and the code that implements the behaviour and allows running them on separate JVMs. This principle facilitates the clients to focus on the definition of a service while the servers can focus on providing the service.

 
by Dinesh Thakur Category: Introduction to Java

Java program has two types. They are:

 

1. Application Program (Stand-alone application)

2. Applets Program.



 
by Dinesh Thakur Category: Introduction to Java

In this Example we Reading the numbers and string in the class Scanner becomes analogous to reading string. In this example, the two numbers are read from the console, results printed on the screen formatted output.

 
by Dinesh Thakur Category: Introduction to Java

In the Following Java Example, shows how to Create a Class Using Java Example. in this example we show that Syntax of java object creation is <className> objectName = new <classConstructor>; and the Syntax of defining methods of the java class is <modifier> <return-type> method-Name(<optionalParameterList>) <ExceptionList>



 
by Dinesh Thakur Category: Introduction to Java

Applet: A small program for specific functions, which usually come with the operating system. Examples in Windows are Paint and Notepad. On a Macintosh, examples are Calculator and Scrapbook. The name comes from the term "applications" which is one variety of a software program.



 
by Dinesh Thakur Category: Introduction to Java

We will now make a small program that will input two integers in Java and display their sum. In this program, we will use the methods available in Scanner class to read data typed at keyboard and place it into variables that we specify.



 
by Dinesh Thakur Category: Introduction to Java

The Java RMI comes along with Java JDK l.l and higher versions. It is a true distributed computing application interface for Java. Java RMI is language-specific, and can provide more advanced features like serialization, security and so on.



 

Page 4 of 80

What's New and Popular