Skip to main content

Posts

Showing posts from October, 2022

JAVA-OOPS: ABSTRACTION

This post covers the topic Abstraction  ABSTRACTION: Hiding the implementation part is called abstraction It has 2 types, Partial abstraction (abstract class) Full abstraction (interface) 1. Partial Abstraction (Abstract class): It will support abstract method and non-abstract method. We can’t create object for abstract class because in the method signature we didn't mention any business logic. In abstract method, we only mention abstract signature, won't create business logic It have 2 class, abstract class (sub class) and super class. we create object and business logic only in super class, won't create in abstract class Example Program: abstract class public abstract class Bank {      abstract void saving();           //method signature      abstract void current();      abstract void salary();      abstract void joint();      public void branchDetails(){      ...

JAVA-OOPS: POLYMORPHISM

This post covers the topic Polymorphism POLYMORPHISM Poly->many Morphism->forms Taking more than one forms is called polymorphism or one task completed by many ways It has 2 types, Method overloading (static binding/compile time polymorphism) Method overriding (dynamic binding/run time polymorphism) 1. Method overloading: Class->same Method->same Argument->differ In a same class method name is same and the argument is different is called method overloading the argument is depends on data types data types count data type order Example Program: public class StudentInfo {      private void studentId(int num) {      }      private void studentId(String name) {      \\ depends on order      }      private void studentId(String email, int ph) {      \\depends on data type      }      private void studentId(int dob, String add) {    ...

Java Interview Questions For Selenium Testers

This post covers Core Java Interview Questions for Selenium Automation Testers. Question 1: Why did you choose Java? Answer:  Java is open source and easy to learn. Writing, Compiling and debugging is easy. We can reuse the code. Question  2: What are all the features of Java? Answer:  Question 3: Why Java is platform independent? Answer:  Java compiler converts Source code to Byte Code. We can run it in any platform such as Windows, Mac, and Linux etc. Question 4: Data types and Its Default Values? Answer: Data type has two types namely, Primitive : (Stores directly) Predefined Can store only one value There are no additional methods Non-primitive : (Stores based on reference) Not-Predefined Can store more than one value It references a memory location which stores the Data. (Reference variables) Default Values: Data Type Memory Size (Byte) Default Value Wrapper Class byte 1 0 Byte Short 2 0 Sh...