Article On Java
Article On Java
-------------------------------------------------------------------------------
In the era of coding and programming where Hindi and English languages are no more
enough to communicate with a machine ,
hence was introduced the concept of programs and machine learning.
Since computers and machines are able to do things so efficiently and accurately,
we use computer programming to harness that computing power...
________________________________________________________________________________
The Java programming language was developed by Sun Microsystems in the early 1990s.
//
A Java program to print "Hello World"
System.out.println("Hello World");
}
}
Output :
Hello World
___________________________________________________________________________________
____________
Java is extremely portable. The same Java application will run identically on any
computer, regardless of hardware features or operating system, as long as it has a
Java interpreter.
Besides portability, another of Java's key advantages is its set of security
features which protect a PC running a Java program not only from problems caused by
erroneous code but also from malicious programs (such as viruses).
You can safely run a Java applet downloaded from the Internet, because Java's
security features prevent these types of applets from accessing a PC's hard drive
or network connections.
An applet is typically a small Java program that is embedded within an HTML page.
Java is a dynamic language where you can safely modify a program while it is
running, whereas C++ does not allow it.
This is especially important for network applications that cannot afford any
downtime.
Also, all basic Java data types are predefined and not platform-dependent, whereas
some data types can change with the platform used in C or C++ (such as the int
type).
Another key feature of Java is that it is an open standard with publicly available
source code.
___________________________________________________________________________________
_____________
Ans: The constructor of a class is invoked every time an object is created with new
keyword.
For example, in the following class two objects are created using new keyword and
hence, constructor is invoked two times.
const_example()
{
system.out.println("Inside constructor");
}
___________________________________________________________________________________
__________
try {
excMethod();
}
catch (ManualException e) {}
}
public void excMethod {
if (name == null) {
___________________________________________________________________________________
___________
The basic requirement of method overriding in Java is that the overridden method
should have same name,
and parameters.But a method can be overridden with a different return type as long
as the new return type extends
the original.
Class B extends A
{
A method(int x){
//original method
B method(int x)
{
//overridden method
}
___________________________________________________________________________________
_________________
The best thing about Java is that it is machine independent and can be written once
and run anywhere.
Furthermore, Java is a statically typed programming language that makes it faster
than other languages.
Java considers security as part of its design...