8:53 am - Thursday February 22, 2018

Basic Interview Question2

Corporate Training for Experienced Candidate
Struts | Hibernate | Spring | Java / J2EE
SOAP | RestFull | Design Pattern | more...
Ph: +91 72000 69003
137b, 2nd st, shanthi nagar, Chrompet, Chennai -600044

21.What is mean Abstract Class ?

Abstract classes can be used to implement the inheritance relationship between the classes that belongs same hierarchy.
Classes and methods can be declared as abstract.
If a Class is declared as abstract , no instance of that class can be created.
If a method is declared as abstract, the sub class gives the implementation of that class.
Even if a single method is declared as abstract in a Class , the class itself can be declared as abstract.
In abstract Class the keyword abstract must be used for method.
Abstract class cannot be marked as final
22.Difference Between Interfaces And Abstract class ?
All the methods declared in the Interface are Abstract, where as abstract class have both abstract method and concrete.
In abstract class keyword abstract must be used for method, where as in Interface we need not use the keyword for methods(interface methods are by default abstract).
Interface can have only abstract method and constants
Interface does not have constructor where as abstract class have constructor.

23.What are access specifiers and access modifiers ?
: The Variables and methods can be access any where and any package.
: The Variables and methods can be access same Class, same Package & sub class. Protected keyword is used when we have different packages
: The variable and methods can be access in same class only.
24. What are Identifiers ?

Identifiers are the Variables that are declared under particular Datatype.
25. What are Literals?

Literals are the values assigned to the Identifiers.
26. Where did the Java name come from? What does it stand for?

The name was chosen during one of several brainstorming sessions held by the Java software team. We were aiming to come up with a name that evoked the essence of the technology — liveliness, animation, speed, interactivity, and more. “Java” was chosen from among many, many suggestions. The name is not an acronym, but rather a reminder of that hot, aromatic stuff that many programmers like to drink lots of.

27. Why developers should not write programs that call ‘sun’ packages

Java Software supports into the future only classes in java.* packages, not sun.* packages. In general, API in sun.* is subject to change at any time without notice. For more details, see the article Why Developers Should Not Write Programs That Call ‘sun’ Packages.

28. What releases of Java technology are currently available? What do they contain?

The Java programming language is currently shipping from Sun Microsystems, Inc. as the Java Development Kit (JDKTM). All Sun releases of the JDK software are available from the JDK software home page (http://java.sun.com/products/jdk/). Each release of the Java Development Kit (JDK) contains:

Java Compiler
Java Virtual Machine*
Java Class Libraries
Java AppletViewer
Java Debugger and other tools
Documentation (in a separate download bundle)
To run Java 1.0 applets, use Netscape Navigator 3.x or other browsers that support Java applets. To run Java 1.1.x applets, use HotJavaTM 1.x or Netscape Navigator 4.x or other browsers that support the newest version of the Java API.

29.What is the difference between a constructor and a method?

A constructor is a member function of a class that is used to create objects of that class. It has the same name as the class itself, has no return type, and is invoked using the new operator.
A method is an ordinary member function of a class. It has its own name, a return type (which may bevoid), and is invoked using the dot operator.
30.How are this() and super() used with constructors?

A: This() is used to invoke a constructor of the same class. super() is used to invoke a superclass constructor.

Filed in: Z-A Interview Questions

No comments yet.

Leave a Reply