Yes. An interface can extend multiple interfaces, as shown here:

interface Maininterface extends inter1, inter2, inter3{  
  // methods
}

A single class can also implement multiple interfaces

interface A
{
    void test();
}

interface B 
{
    void test();
}

class C implements A, B
{
    @Override
    public void test() {

    }     
}

Single implementation works for both.

Yes.You can use any kind of method in an abstract class

public abstract class AbstractDAO{

public void save(){
  validate();
  //save
}
  private void validate(){ // we are hiding this method
  }
}

Private Constructors
If Private constructor is the only constructor of the class, then the reason is clear: to prevent subclassing. Some classes serve only as holders for static fields/methods and do not want to be either instantiated or subclassed. Note that the abstract modifier is in this case redundant—with or without it there would be no instantiation possible. The abstract modifier is also bad practice because it sends wrong signals to the class’s clients. The class should in fact have been final.

Abstract Class with Private Constructor is same as Final Class. Both serves the same purpose.

Q1.What is the difference between Singleton vs Factory pattern?
A singleton pattern ensures that you always get back the same instance of whatever type you are retrieving, whereas the factory pattern generally gives you a different instance of each type.

The purpose of the singleton is where you want all calls to go through the same instance. An example of this might be a class that manages a disk cache, or gets data from a static dictionary; wherever it is important only one known instance interacts with the resource. This does make it less scalable.The purpose of the factory is to create and return new instances. Often, these won’t actually be the same type at all, but they will be implementations of the same base class. However, there may be many instances of each type

Q2.How to stop create instance via Reflection in Singleton

private Singleton() {
    if (singleton != null) {
        throw new IllegalStateException("Singleton already constructed");
    }
}

Q3.What are different ways of preventing object creation in singleton?
There are 5 ways of creating Objects. The below code explains how to prevent object creation by all 5 methods. Instead of
doing all these we can create singleton by using ENUM
Singleton.java

public class Singleton implements Serializable 
{
 private static final long serialVersionUID = 3119105548371608200 L;
 private static final Singleton singleton = new Singleton();
 
 //Prevents Class creation by Constructor
 private Singleton() 
 {
     //Prevents Object creation by reflection
     if( Singleton.singleton != null ) 
     {
        throw new InstantiationError( "Creating of this object is not allowed." );
     }
 }
 
 public static Singleton getInstance() 
 {
  return singleton;
 }
 
 //Prevents Class creation during cloning
 @Override
 protected Object clone() throws CloneNotSupportedException 
 {
  throw new CloneNotSupportedException("Cloning of this class is not allowed");
 }
 
 //Prevents New Object Creation by returning same singleton object
 protected Object readResolve() 
 {
  return singleton;
 }
}

Main.java

try {
    Class<Singleton> singletonClass = (Class<Singleton>) Class.forName("test.singleton.Singleton");
    Singleton singletonReflection = singletonClass.newInstance();
} catch (ClassNotFoundException e) {
    e.printStackTrace();
} catch (CloneNotSupportedException e) {
    e.printStackTrace();
} catch (IllegalAccessException e) {
    e.printStackTrace();
}

JAX-WS – is Java API for the XML-Based Web Services – a standard way to develop a Web- Services in SOAP notation (Simple Object Access Protocol).

Calling of the Web Services is performed via remote procedure calls. For the exchange of information between the client and the Web Service is used SOAP protocol. Message exchange between the client and the server performed through XML- based SOAP messages.

Clients of the JAX-WS Web- Service need a WSDL file to generate executable code that the clients can use to call Web- Service.

JAX-RS – Java API for RESTful Web Services. RESTful Web Services are represented as resources and can be identified by Uniform Resource Identifiers (URI). Remote procedure call in this case is represented a HTTP- request and the necessary data is passed as parameters of the query. Web Services RESTful – more flexible, can use several different MIME- types. Typically used for XML data exchange or JSON (JavaScript Object Notation) data exchange

POJO Plain Old Java Object. Basically a class with attributes and its getters and setters.

public class User
{
 private String name;
 private int age;

 public void setName(String name){
    this.name = name;
 }

 public String getName(){
    return this.name;
 }

 //same for age

}

POJO vs Java Beans
A JavaBean is a Java object that satisfies certain programming conventions:

  1. all JavaBean properties must have public setter and getter methods (as appropriate);
  2. all JavaBean instance variables should be private.
  3. the JavaBean class must have a no-arg constructor
  4. the JavaBean class must implement either Serializable or Externalizable;

Advantages of Bean

  1. A Bean obtains all the benefits of Java’s “write-once, run-anywhere” paradigm.
  2. The properties, events, and methods of a Bean that are exposed to an application
    builder tool can be controlled.
  3. A Bean may be designed to operate correctly in different locales, which makes it
    useful in global markets.
  4. The configuration settings of a Bean can be saved in persistent storage and restored
    at a later time.
  5. A Bean may register to receive events from other objects and can generate events that
    are sent to other objects.

Advantages of POJO

  1. Getter & setter methods allow you to change the underlying data type without breaking the public interface of your class which makes it (and your application) more robust and resilient to changes
  2. You might want to call some other code such as raising a notification when the value is obtained or changed like in java bean. This is not possible with your current class.
  3. You can expose values that are not backed by a field I.E. calculated values such as getFullName() which is a concatenation of getFirstName() and getLastName() which are backed by fields.
  4. You can add validation to your setter methods to ensure that the values being passed are correct. This ensures that your class is always in a valid state.
  5. If the field is an object (I.E. not a primitive type) then the internal state of your class can be modified by other objects which can lead to bugs or security risks. You can protect against this scenario in your POJO’s getter by returning a copy of the object so that clients can work with the data without affecting the state of your object. Note that having a final field does not always protect you against this sort of attack as clients can still make changes to the object being referenced (providing that object is itself mutable) you just cannot point the field at a different reference once it has been set.

What is Limit Order?
Maximum Price you could afford to pay to buy a Share (or)
Minimum Price at which you are ready to sell a share

What is Limit Buy Order?
For example, a buy limit order can be put in for $2.40 when a stock is
trading at $2.45. If the price dips to $2.40, the order is automatically executed.

What is Sell Limit Order?
For example, a sell limit order can be put in for $2.40 when a stock is
trading at $2.35. If the price dips to $2.40, the order is automatically executed.

For example, a sell limit order can be put in for $2.40 when a stock is
trading at $2.35. If the price dips to $2.40, the order is automatically executed.

What is Stop-Limit Order?
A stop-limit order is an order placed with a broker that combines the features of a stop order
with those of a limit order. A stop-limit order will be executed at a specified price, or better, after a
given stop price has been reached. Once the stop price is reached, the stop-limit order becomes a limit
order to buy or sell at the limit price or better.

A stop-limit order requires the setting of two price points. The first point initiates the start of
the specified action, referred to as the stop, while the second represents the outside of the
investor’s target price, referred to as the limit. A timeframe must also be set,
during which the stop-limit order is considered executable.

For example, assume that ABC Inc. is trading at $40 and an investor wants to buy the stock once it begins to show some serious upward momentum. The investor has put in a stop-limit order to buy with the stop price at $45 and the limit price at $46. If the price of ABC Inc. moves above $45 stop price, the order is activated and turns into a limit order. As long as the order can be filled under $46, which is the limit price, the trade will be filled. If the stock gaps above $46, the order will not be filled.

import com.eviware.soapui.impl.wsdl.teststeps.*

def list = []
list.add(jsessionid)
def headers = testStep.testRequest.requestHeaders
headers["Cookie"] = list
testStep.testRequest.requestHeaders = headers
log.info testStep.testRequest.requestHeaders["Cookie"]
package com.mugil.first
import jxl.*
import jxl.write.*


class ExcelUtils {
	public static void main(String[] args)
	{
		writeExcel()
		readExcel()
	}
	
	static def writeExcel()
	{
		WritableWorkbook workbook = Workbook.createWorkbook(new File("d:\\output.xls"))
		WritableSheet sheet = workbook.createSheet("Worksheet1", 0)		 
		
		for(int i=0;i<3;i++)
		{
			for(int j=0;j<5;j++)
			{
				Label label = new Label(i, j, i+","+j);
				sheet.addCell(label);
			}
		}		
		
		workbook.write()
		workbook.close()	
		
	}
	
	static def readExcel()
	{
		Workbook workbook1 = Workbook.getWorkbook(new File("d:\\output.xls"))
		Sheet sheet1 = workbook1.getSheet(0)
		Cell a1 = sheet1.getCell(0,2) 
		Cell b2 = sheet1.getCell(2,2) 
		Cell c2 = sheet1.getCell(2,1)
		
		println a1.getContents();
		println b2.getContents();
		println c2.getContents();		
		
		workbook1.close()
	}
}