Question Related to Abstract Class

Q1: Must abstract classes contain at least one abstract method? A: No, abstract classes are not required to have any abstract methods, they can simply be marked abstract for general design reasons. An abstract class may contain a full set of functional, integrated methods but have no practical use in its basic form, for example. In other words, they may require extension with additional methods to fulfil a range of different purposes. If the purpose is not specified by abstract method signatures, the range of potential applications for subclasses...

Abstract Class In Java

Java Abstract classes are used to declare common characteristics of subclasses. An abstract class cannot be instantiated. It can only be used as a superclass for other classes that extend the abstract class. Abstract classes are declared with the abstract keyword. Abstract classes are used to provide a template or design for concrete subclasses down the inheritance tree.Like any other class, an abstract class can contain fields that describe the characteristics and methods that describe the actions that a class can perform. An abstract class can...

Solution of Inconsistent Control File

Inconsistent error occur when Oracle detects an inconsistency between the multiplex copies of the control file. All copies of the control file must have the same internal sequence number Typical scenarios in which you may receive this inconsistencu error include: 1. You have restored the control file from backup, but you have forgot to copy it to other locations of the control file as listed in the "CONTROL_FILES" parameter in the initialization parameter. 2. You have moved one or more copies of the control file to a different location while...

User Managed Restore Procedure in Oracle

If someone has deleted datafile,there is user errors or disk is crushed then there is necessary to restore a datafile from backup. If you restore any datafile then just copy it to the location in the parameter specified in the control_files. If you restore any control file then copy in the destination which spfile or pfile points in control_files parameter. In the following section you can know what you do if you choose user managed recovery:  1) If all copies of the control file have lost and you have backup of the control file then simply...

Recovering a Database in NOARCHIVELOG Mode

In NOARCHIVELOG mode the recovery is very simple. All you have to do is to restore the database files from your backup to the original location  and start the database. If one of your data file got corrupted. The time try to start the Oracle Instance, it will give you an error. In this case shutdown the database. Restore all the data files, redo log files and control file back to their original location from your last whole/complete cold backup.Then start the Oracle database again and then connecting as SYSDBA.There are some steps as following: 1)...

Difference Between Interface and Abstract Class

1) An Interface should contain only definitions but no implementation. where as an abstract class can contain abstract and non-abstract methods.  2) Abstract class contains one or more abstract methods. where as Interface contains all abstract methods and final declarations 3) Abstract class contains the method defination of the some methods. but Interface contains only method declaration, no defination provided. 4) Interface must always have by default public and abstract methods.while abstract class can have non abstract methods5) Abstract...

Is interface is Final in Java?

Is interface is Final in Java?  Interfaces are 100% abstract and the only way to create an instance of an interface is to instantiate a class that implements it. Allowing interfaces to be final is completely pointless. A final interface is one that cannot be extended by other interfaces .but it is senseless that we cannot implements or extends the inheritance.because to declare an interface means to implements its methods which we can't do if we mark interface as final. So interface is never final in  java. Lets take an example  final...

What is marker Interface?when it is used?

What is marker Interface?when it is used? Marker interface is that interface which has no members in it.Marker interface is used as a tag to inform a message to the java compiler so that it can add special behaviour to the class implementing it. It is also known as null interface. Definition: “An interface is called a marker interface when it is provided as a handle by java interpreter to mark a class so that it can provide special behaviour to it at runtime and they do not have any method declarations”.  It is used in the following scenario: Lets...

Java Interfaces Advantages and Disadvantages

Advantages:   1) through interfaces we can implement multiple inheritance in java. 2) Interfaces function to break up the complex designs and clear the dependencies between objects. 3) Interfaces makes your application loosely coupled.   Disadvantages:   1) Java interfaces are slower and more limited than other ones. 2) Interface should be used multiple number of times else there is hardly any use of having th...

Java Interfaces

An interface is a collection of abstract methods. A class implements an interface, thereby inheriting the abstract methods of the interface. It is an interface through which multiple inheritance is implemented in Java. We can implements more than one interfaces in Java. An interface is not a class. Writing an interface is similar to writing a class, but they are two different concepts. A class describes the attributes and behaviors of an object. An interface contains behaviors that a class implements.  one thing to be notice: Class implements...

Dropping Redo Log Group or Member

Dropping  Redo Log  Group: To increase or decrease the size of online redo log groups you add or drop online redo log groups. To drop a redo log you must have the alter database system privilege.Use the alter database drop logfile group you can drop the redo log group. Alter database drop logfile group 3; But before drop a redo log group follow the following restrictions:An insatnce requires at least two groups. You cannot be dropped active or current group means a group can drop only if it is inactive. Make sure a redo log group is archived.Whan...

Status Of Redo Log File

To see the status of redo log file you have the following two dynamic views:1) V$LOG2) V$LOGFILE SQL>desc v$logThis command will provide you information about GROUP#, THREAD#, SEQURNE#, BYTES, MEMBERS, STATUS, FIRST_TIME. You can see the status of redo log file by using STATUS column: SQL>select status from v$log; STATUS --------------UNUSED- Online redo log has never been written to. This is the state of a redo log that was just added, or just after a RESETLOGS, when it is not the current redo log. CURRENT- Current redo log. This implies...

Difference between HibernateDaoSupport and HibernateTemplate

The biggest difference I know of is that the HibernateTemplate created by HibernateDaoSupport is allowed to create Hibernate sessions (allow create) if no session is bound to the current thread. You can change the value through the allow Create property on HibernateTemplate though. HibernateTemplate (a Hibernate class) is a property of the HibernateDaoSupport class (a Spring clas...

Difference between APPLET and SERVELT

Ques.IN JAVA WHAT IS DIFFERENCE BETWEEN APPLET AND SERVELT? Ans.1) Applet is client side application whereas Servlet is Server side application. 2) An applet is a Java program that runs within a Web browser on the client machine whereas a servlet runs on the Web server. 3) An applet can use the user interface classes like AWT or Swing while the servlet does not have a user interface. 4) Servlet is a server, Applet is a browser. 5) Applet is a downloadable small program which runs on the client side and executed by the client's java enabled browser...

Difference between ArrayList and Vector

Q.What are key difference between ArrayList vs Vector in Java? Ans.1) ArrayList is not thread safe where the Vector is i.e methods of vector are synchronized whereas ArrayList's methods are not. 2) ArrayList is fast as compared to Vector. 3) Vector and ArrayList both uses Array internally as data structure. They are dynamically resizable. Difference is in the way they are internally resized. By default, Vector doubles the size of its array when its size is increased. But, ArrayList increases by half of its size when its size is increased. 4) ArrayList...

Why multiple Inheritance is not allowed in Java?

Q. Why multiple Inheritance is not allowed in Java? A. We always want to extend multiple classes so that we inherits the features of the multiple classes. For example: class C extends A,B { } but the above declaration is not valid in Java. In Java ,one class cannot extends from multiple classes. we can extend only from single class. But Java supports multilevel inheritance, means it will have multiple ancestors .For example class C extends B{} class B extends A{} Here,  C class inherits...

this and super - Keywords

The two keywords, this and super to help you explicitly name the field or method that you want. Using this and super you have full control on whether to call a method or field present in the same class or to call from the immediate superclass. This keyword is used as a reference to the current object which is an instance of the current class. The keyword super also references the current object, but as an instance of the current class’s super class. The this reference to the current object is useful in situations where a local variable hides,...

Inheritance Advantages and Disadvantages

Advantages:-  One of the key benefits of inheritance is to minimize the amount of duplicate code in an application by sharing common  code amongst several subclasses. Where equivalent code exists in two related classes, the hierarchy can usually be  refactored to move the common code up to a mutual superclass. This also tends to result in a better organization of  code and smaller, simpler compilation units. Inheritance can also make application code more flexible to change because classes that inherit from a common ...

What is not possible using java class inheritance?

What is not possible using java class Inheritance? 1 Private members of the superclass are not inherited by the subclass and can only be indirectly accessed. 2. Members that have default accessibility in the superclass are also not inherited by subclasses in other packages, as  these members are only accessible by their simple names in subclasses within the same package as the superclass. 3. Since constructors and initializer blocks are not members of a class, they are not inherited by a subclass. 4. A subclass can extend only one supercl...

Java Inheritance

Java Inheritance defines an is-a relationship between a super class and its sub classes.This means that an object of a subclass can be used wherever an object of the superclass can be used. Class Inheritance in java mechanism is used to build new classes from existing classes. The inheritance relationship is transitive: if class x extends class y, then a class z, which extends class x, will also inherit from class y. For example a car class can inherit some properties from a general vehicle class. Here we find that the base class is the vehicle...

Multiplexing Redo log File

Multiplex redo log by adding group: Redo log files are used to record changes made to the database. Redo log files are important for the recovery purpose.So thats why in some cases you might need to create additional log file groups. To create a new group of online redo log files use the following SQL command: Alter database add logfile group 3 ('/opt/luck/redo03_00.log',                                                  ...

How Redo Logs Work

The online redo log of a database consists of two or more online redo log files. Oracle needs a minimum of two files to guarantee that one is always available for writing while the other is being archived.The Oracle server sequentially records all changes made to the database in the redo log buffer. The redo entries are written from the redo log buffer to one of the online redo log groups called the current online redo log group by the LGWR process. LGWR writes under the following situations:When...

Online Redo Log File

Each transaction is recorded in the redo logs.Redo logs stroe all changes made to the database. In the oracle database every instance has online redo log to protect the database in any case of an instance failure.Every oracle database instance has its own online redo log group. Online redo log files are filled with redo records are also called redo entry. If you change any value in a table then you generate a redo record that describe changes to the data segment block for the table and the...

How To Create New Control File

As you know control file records the information about the physical structure of the database.It is very crucial file it is veru small binary file, So thats why we create multiplexing of control file and we back up control file time to time.But sometime when all control file have been damaged then we need to create new control file as follow: CREATE CONTROLFILE    SET DATABASE luck    LOGFILE GROUP 1 ('/opt/luck/redo01.log',                  ...

Share

Twitter Delicious Facebook Digg Stumbleupon Favorites More