"abstraction" Code Answer's

You're definitely familiar with the best coding language Whatever that developers use to develop their projects and they get all their queries like "abstraction" answered properly. Developers are finding an appropriate answer about abstraction related to the Whatever coding language. By visiting this online portal developers get answers concerning Whatever codes question like abstraction. Enter your desired code related query in the search bar and get every piece of information about Whatever code related question on abstraction. 

what is abstraction

By Thankful TuataraThankful Tuatara on Nov 28, 2020
it is process of hiding implementation details and 
only showing the functionality to the user. 
Abstraction focus on what the object does instead of how it does. 
It is achieved by using Abstract class and Interface. 
abstract methods (methods without body, cannot be static and final), 
interface must implemented and abstract classes must be extended 
by regular classes in order to achieve abstraction 
(because abstract methods can only be exist in abstract class and interface). 
A class can implement multiple interfaces, 
but it can extend only single abstract class.

Ex: In my framework I have achieve abstraction by using collections or 
Map, because it’s all interface. Most of the cases I come across using List. 
If we want to access elements frequently by using index, List is a way to go. 
ArrayList provides faster access if we know index. 
If we want to store elements and want them to maintain an order, 
List is a better choice.

i)List<String> webs=driver.getWindowHandles();
=>create a list first to store web URLs in list

ii)findElements evaluates multiple elements so therefore will assigned 
to List <WebElement>

iii)To handle dynamic elements store it in the list and identify by index:
List<WebElement> all=driver.findElements(By.tagname(“”)); (or other locators).

Add Comment

9

what is abstraction in java

By Obedient OcelotObedient Ocelot on Jan 05, 2021
Sometimes we may come across a situation
where we cannot provide implementation to
all the methods in a class. We want to leave the 
implementation to a class that extends it.
  In that case we declare a class
as abstract by using abstract keyword on method
signature.In my framework I have created my
PageBase class as super
class of the all page classes. 
I have collected all common elements
and functions into PageBase class and
all other page classes extent PageBase class.
By doing so, I don't have to locate very
common WebElements and it provides
reusability in my framework.
Also
1)Abstract classes cannot be instantiated
2)An abstarct classes contains abstract method,
concrete methods or both.
3)Any class which extends abstarct class must
  override all methods of abstract class
4)An abstarct class can contain either
  0 or more abstract method.   

Add Comment

2

abstraction

By Obedient OcelotObedient Ocelot on Jan 05, 2021
Sometimes we may come across a situation
where we cannot provide implementation to
all the methods in a class. We want to leave the 
implementation to a class that extends it.
  In that case we declare a class
as abstract by using abstract keyword on method
signature.In my framework I have created my
PageBase class as super
class of the all page classes. 
I have collected all common elements
and functions into PageBase class and
all other page classes extent PageBase class.
By doing so, I don't have to locate very
common WebElements and it provides
reusability in my framework.
Also
1)Abstract classes cannot be instantiated
2)An abstarct classes contains abstract method,
concrete methods or both.
3)Any class which extends abstarct class must
  override all methods of abstract class
4)An abstarct class can contain either
  0 or more abstract method.  

Add Comment

2

abstraction

By OzzzyOzzzy on May 28, 2021
Abstraction: Hiding the implementation details, 
concentrating on essentials things, 
without worrying about the details 
■ In java, abstraction is achieved via abstract class or interface 
■ Abstraction cannot exist without inheritance 

3.1. Abstract class a class that's meant to be inherited 
(cannot be private or final)
■ To create an abstract class: add keyword abstract 
before the class declaration 
■ A class that we cannot create object 
when abstract class extended by regular class: 
we MUST override all the abstract methods of super class
when abstract class extended by abstract class: 
no need to override any abstract methods

abstract class vs non-abstract class:
NON-ABSTRACT CLASS:
cannot have: abstract methods
can have: constructor, instance method, static method, 
instance block, static block, instance variable, static variable
ABSTRACT CLASS:
can have: constructor, instance method, static method, instance block,
static block, instance variable, static variable...
ABSTRACT METHOD: method without implementation, meant to be override 
(cannot create object, cannot be final,static,private)

FRAMEWORK EXAMPLE:
In my framework I have achieved abstraction by using collections 
or Map, because it’s all interface. Most of the cases I come 
across using List. If we want to access elements frequently 
by using index, List is a way to go. ArrayList provides 
faster access if we know index. If we want to store elements and 
want them to maintain an order, List is a better choice. 
i) List webs = driver.getWindowHandles();    
=>create a list first to store web URLs in list
ii)To handle dynamic elements store it in the list and identify by index
List all = driver.findElements(By.tagname(“”));
In my framework I follow POM and had situations where some pages 
shared similar actions that were similar but worked slightly 
different, so I was able to use abstraction to define those 
actions and implement them in each page according to what was needed 
for that webpage

Add Comment

0

abstraction definition

By QuietHumilityQuietHumility on Jun 12, 2021
Dealing with ideas rather than actual events.

Add Comment

0

All those coders who are working on the Whatever based application and are stuck on abstraction can get a collection of related answers to their query. Programmers need to enter their query on abstraction related to Whatever code and they'll get their ambiguities clear immediately. On our webpage, there are tutorials about abstraction for the programmers working on Whatever code while coding their module. Coders are also allowed to rectify already present answers of abstraction while working on the Whatever language code. Developers can add up suggestions if they deem fit any other answer relating to "abstraction". Visit this developer's friendly online web community, CodeProZone, and get your queries like abstraction resolved professionally and stay updated to the latest Whatever updates. 

Whatever answers related to "abstraction"

View All Whatever queries

Whatever queries related to "abstraction"

Browse Other Code Languages

CodeProZone