You are here:   HomeJava ProgrammingIntroduction to JavaEncapsulation in Java
by Dinesh Thakur Category: Introduction to Java

It is quite a tedious job to keep track of all the objects that have been created during the program development. It is tougher to keep track of the objects that are not being used now or their reference have been removed or the objects that have gone out of scope.

 
by Dinesh Thakur Category: Introduction to Java

Public keyword is an access specifier.

Static allows main() to be called without having to instantiate a particular instance of class.

 
by Dinesh Thakur Category: Introduction to Java

In the real world, you'll often find many individual objects all of the same kind.All the objects that have similar properties and similar behavior are grouped together to form a class.

 
by Dinesh Thakur Category: Introduction to Java

A java class containing all the methods as abstract is called an interface. A method that has no implementation and which is expected to be implemented by a subclass is called an abstract method.



 
by Dinesh Thakur Category: Introduction to Java

The Java Compiler (Javac) is a command line tool that reads java source code files and compiles them into executable Java bytecode classes. The Java source code must be contained in files whose file names end with .java extension.



 
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.

 

Page 2 of 3



Subscribe To Free Daily Newsletter!

Get Free News Updates Delivered Directly To Your Inbox
About Dinesh Thakur

Dinesh ThakurDinesh Thakur holds an B.SC (Computer Science), MCSE, MCDBA, CCNA, CCNP, A+, SCJP certifications. Dinesh authors the hugely popular Computer Notes blog. Where he writes how-to guides around Computer fundamental , computer software, Computer programming, and web apps. For any type of query or something that you think is missing, please feel free to contact us.



What's New and Popular