What is polymorphism in java with example

What is polymorphism in java with example

polymorphism means one object can take multiple forms. lets explain this using a method poly() in java class.

steps:

  1. create a package polymorphismPkg in eclipse
  2. create a class polymorphismClass  in eclipse
  3. now write below code in the class polymorphismClass  

package polymorphismPkg;

public class polymorphismClass {

public static void main(String[] args) {

polymorphismClass obj1 = new polymorphismClass();

obj1.poly(1, 2);
obj1.poly(1, 2, 3);
obj1.poly(1, 22.11);

}

public static void poly(int a, int b)

{
System.out.println(“this is first method for polymorphism”);
}

public static void poly(int n, int b, int c)

{
System.out.println(“this is like first method but number of argument is different in signature “);

}

public static void poly(int n, double b)

{
System.out.println(“this is like first method but argument order is different in the signature “);

}

}

 

 

 

What is Inheritance in Java with example

What is Inheritance in Java with example

One class in Java can get the methods and properties from other class – this helps reducing the coding efforts , increase code reusability and maintainability.

e.g. 

public class classB extends classB {

}

in the above Java code, classB class gets the methods and properties from classA class.

steps,

  1. create a meaningful project and a package in eclipse
  2. create 2 classes classA and classB under the package (Codes are below)

Code for classA class as below:

package inheritancePkg;

public class classA {

public void A()

{

System.out.println(“this is from father class”);
}

}

 

Code for classB class as below:

package inheritancePkg;

public class classB extends classA // extends classA is inheritance from classA class to classB

// so we are able to write obj1.add() from father.

{
public static void main(String[] args)
{

classB obj1 = new classB();
obj1.A();
obj1.B();

}

public void B()

{
System.out.println(“this is from son class “);

}

}

 

Top 5 sql interview questions and answers

Top 5 sql interview questions and answers

What is DDL, DML, DCL, TCL in SQL ?

DDL refers to Data Definition language. DDL is used to create/modify the structure of Database. e.g. CREATE, ALTER, DROP statement..

DML refers to Data Manipulation language. DML is used to retrieve, modify, delete, insert and update data in database. e.g. SELECT, UPDATE, INSERT statement

DCL refers to Data Control Language. DCL is used to create roles, permissions, and control access to database. e.g. GRANT, REVOKE statement.

TCL refers to Transactional Control Language. TCL is used to manage different transactions occurring within a database. e.g COMMIT, ROLLBACK statement

What is the difference between UNION vs UNION ALL?

          UNION and UNION ALL are used for merging two tables which has similar structure.

the difference between UNION and UNION ALL is that the UNION removes the duplicates while merging tables but UNION ALL do not and retain all duplicates.

UNION is slower in performance  as it has additional task of removing duplicates which causes more time in  execution.

What is the difference between query and subquery?

A Query is a code written to fetch information from the database where as subquery is a query within another query.  Basically subquery is an inner query. SubQuery is designed to executed first. The result of subquery is passed on to the main query which then process using the subquery output.

What is a stored procedure?

Stored Procedure is a function having several SQL statements. Stored procedure can be executed to process all SQL statements in it.

What is the difference between WHERE clause and HAVING clause?

Both WHERE and HAVING are used for filtering out records based conditions. WHERE clause can only be applied for static non-aggregated column whereas HAVING for aggregated columns.
SELECT * FROM Cricketbat WHERE batlenght > 2 feet
SELECT COUNT(Cricketbat)
FROM Bat
GROUP BY Team
HAVING COUNT(Cricketbat) > 2 feet;

What is DELETE and TRUNCATE commands?

DELETE command is used to remove selected rows from a table. A WHERE clause can be used to specify the rows to be deleted

 

What is difference between select and select distinct

Top 5 Salesforce Interview questions

Top 5 Salesforce Interview questions

1. What is object in salesforce?

Objects are database tables used to store specific data. There are two types of objects. 1. Standard objects 2. Custom objects.

2. What are different types of relationship in salesforce?

There are two different types of relationship in salesforce.
1. Master detail relationship
2. Lookup relationship

3. What is a trigger in salesforce ?

A Trigger is a code that is executed before or after a record is inserted or updated.

4. How many reports can be added to salesforce dashboard ?

20

5. What is validation rule ?

While creating or modifying a record, based on certain conditions validation rule helps to display error message.

6. What are escalation rules in sales force?

Escalation rules can be created on sales force case object and based on priority escalation emails can be sent.

What is TestRunner in Cucumber

What is TestRunner in Cucumber

TestRunner is a program used in Cucumber to access Feature file as copied in the picture below.

Feature file is something that has user requirement scenarios  written in English which gives more readability and understandability of the requirement which is called Gherkin language.

So any roles in the company  like Tester, developer, end user, and techno functional person can read it and understand it. Also this will reduce the complication in terms of missing requirement or misrepresenting or misunderstanding requirements between different roles  like Developer , tester, and  end user,

In order to link Cucumber with Selenium WebDriver, you need to start a Java project in eclipse IDE. Then, add both Cucumber and Selenium jar files

Write test runner code and execute the same . Please refer BDD testing details on Selenium Cucumber

Sample Test runner code:

testrunner
Testrunner

Selenium short video training

Selenium # 26 Selenium Implicit and Explicit wait

Selenium#25 Selenium Keyboard and Mouse events| keyDown(); keyUp(); sendKeys();doubleClick();

Selenium # 24 Coding example | WebElement | locator type xpath, id | driver. findElement short video

Protractor vs Selenium
Robot framework and Selenium2Library

Trending as of Jan 11 2017

Trending as of Jan 11 2017 – My most favorite hobby is market research based on what i read from various news media. I focus mainly on new brands of cars, mobile phones, Laptops, software, new deals on various sites etc.. However this information may not be accurate and this is just my views and what I understood. Others would have their on views..:-)

Date: Jan 11-2017

  1. H1 and L1 Visa news about hiking the minimum wages to $100k is trending news in Indian medias on this week. This news is causing lots concerns on Indian IT professionals living in USA about their Job security as well as IT companies concerns about their margins. Some of the IT majors are already started to make changes to their business model to handle this issues proactovely.

expecting more updates..

2. WhatsApp beta v2.17.6 will be supporting GIF search. this is something i was eagerly looking for. GIF images are light weight files and easy to share and express any flow and is a nice replacement for video clips..:-)

 

Date: Jan 10-2017.

1. 2018 Odyssey minivan’s modern look is amazing and this fifth generation model would definitely hit market with good responses.. Some of the features I likes are..new safety features, design changes, interior seat flexibilty for second row seats,  better technology to avoid collision, cabin control, more power etc

2. Xiaomi Redmi Note 5

Xiaomi expected to release its Note 5 version in 2017 .. Expected to have resolution 1920×1080 pixels with 2.5d curved IPS and 5.5 inch size..

Rear camera expected to have 16MP with PDAF

Expected processor Snapdragon 652 it’s core

Top car companies and their brands

Top car companies and their brands. Some of the top car companies are GM, HYUNDAI, VOLKSWAGEN, GEELY, BMW, PSA,HONDA, NISSAN, FCA, DAIMLER, FORD, TOYOTA, TATA and  RENAULT

Top car brands are,

GM – CHEVROLET, OPEL, HOLDEN, CADILLAC, VAUXHALL, GMC, WULING MOTORS, BAOJUN, BUICK

HYUNDAI – KIA, HYUNDAI

VOLKSWAGEN – AUDI, SKODA, BENTLEY, VOLKSWAGEN, BUGATTI, LAMBORGHINI , PORSCHE

GEELY – GEELY, VOLVO,

BMW – BMW, MINI, ROLLS-ROYCE

PSA -CITROENA,

HONDA – HONDA, ACURA

NISSAN -NISSAN, DATSUN, INFINITI

FCA – FIAT, CHRYSLER,

DAIMLER – BENZ, SMART

FORD – FORD

TOYOTA – TOYOTA, LEXUS, DAIHATSU

TATA – TATA MOTORS, LAND ROVER, JAGUAR

RENAULT – DACIA, RENAULT, SAMSUNG

 

 

My favorite

My favorite …This blog is about my favorite ..

Songs – Side to Side of Ariana grande, Anaconda of Nicki Minaj, Never let you go , Sorry of Justin Bieber.

Singers – Justin Bieber , Taylor swift, Ariana grande,  Vidya Iyer, Lady Gaga & Nicki Minaj

Actress and models – Lisa Haydon, Sonam Kapoor

Actors – Salman Khan, Amir Khan, Shah Rukh Khan

Companies – Amazon, Flipkart, Uber, Google

Movies – Dangal, Sultan

Mobile Phones – Apple iPhone 7 and HTC 10.

Cars –  Tesla Model S, X, 2017 Mercedes-Benz CLA-Class, BMW 5 series, 

SUVs – Mercedes-Benz GLS-class, BMW X6,

Minivan – 2018 Honda  Odyssey, Sienna 2017

Mobile internet connection – Reliance Jio 4G

 

Trending news as of Jan 10 2017

Trending news as of Jan 10 2017 – My most favorite hobby is market research based on what i read from various news media. I focus mainly on new brands of cars, mobile phones, Laptops, software, new deals on various sites etc.. However this information may not be accurate and this is just my views and what I understood. Others would have their on views..:-)

Date: Jan 10-2017.

1. 2018 Odyssey minivan’s modern look is amazing and this fifth generation model would definitely hit market with good responses.. Some of the features I likes are..new safety features, design changes, interior seat flexibilty for second row seats,  better technology to avoid collision, cabin control, more power etc

2. Xiaomi Redmi Note 5

Xiaomi expected to release its Note 5 version in 2017 .. Expected to have resolution 1920×1080 pixels with 2.5d curved IPS and 5.5 inch size..

Rear camera expected to have 16MP with PDAF

Expected processor Snapdragon 652 it’s core

 

 

Sunset from Manhattan New York

Sunset from Manhattan New York. Sunrise and sunset are the beautiful time in a day from anywhere in the world.

Enjoy the Sunset near Central park, New York. Manhattan is one of the must see places in USA.