Java Classes

  Home  Java Programing  Java Classes


“Java Classes frequently Asked Questions in various Java Classes related job Interviews by interviewer. Get preparation of Java Classes job interview questions”



76 Java Classes Questions And Answers

5⟩ What is meant by OO paradigm?

OO paradigm = Object Oriented Paradigm.

This is the basic concept of Object Oriented Languages.It actually means we have to only work out with objects.Communications take place between classes with the help of objects

Ex:- Java,C++ ,But not C(Function Oriented)

 174 views

9⟩ Explain why the StringBuffer and the wrapper classes defined as final?

By defining a class as final we are restricting the one of the main feature of OOP ie., INHERITANCE. But JavaSoft(SUN) has provided this restricting feature because Java Developers thought that some methods cannot be modified by the users. Eg. for those are the methods in String , StringBuffrer ,StringBuilder , all Wrapper classes. As String is a standard class those methods should be as they are as developed by Sun. The user can not be permitted to change the functionality of those methods. If your application needs this type of situation u can decalre your class as final.

The user can't implement the method toUppercase( ) in String class as that it can convert only some of the characters into Uppercase.

 152 views

10⟩ How to load a class from a remote server?

How can classes are loaded from remote server? Don't worry.... please visit the hypelink and will get your ans.... http://java.sun.com/developer/JDCTechTips/2001/tt0227.html#dynamic

 148 views

19⟩ In System.out.println() explain it.My doubt, we call static method with Class name but here what is "out"?

Actually System is class define in java.lang package...

class System{ //Member variables... static PrintStream out;

.................................

//Member methods...

.................

}

so out is a static reference of PrintStream class,which is define in java.io package and println() is a method of PrintStream class...

So ultimately, we can call println() method of static out reference of System class.

Syste.out.println();

 162 views

20⟩ What is difference between abstract class and interface?

1. Abstract class is a class which contain one or more abstract methods, which has to be implemented by sub classes. Interface is a Java Object containing method declaration and doesn't contain implementation. The classes which have implementing the Interfaces must provide the method definition for all the methods.

2. Abstract class is a Class prefix with a abstract keyword followed by Class definition. Interface is a Interface which starts with interface keyword.

3. Abstract class contains one or more abstract methods. where as Interface contains all abstract methods and final declarations.

4. Abstract class contains the method definition of the some methods. but Interface contains only method declaration, no definition provided.

5. Abstract classes are useful in a situation that Some general methods should be implemented and specialization behavior should be implemented by child classes. Interfaces are useful in a situation that all properties should be implemented we can use this scenario

 163 views