Answers for "what does abstraction mean"

21

what is abstraction

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).
Posted by: Guest on November-28-2020
1

abstraction meaning

abstraction is when you don't want your parent class to be assigned memory you just want it to act as a blueprint for the childclass.In system verilog you do it my using virtual keyword in front of class while defining it.
Posted by: Guest on October-26-2021
2

abstraction

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
Posted by: Guest on May-16-2021
3

abstraction definition

Dealing with ideas rather than actual events.
Posted by: Guest on June-12-2021
0

method abstraction

// Method abstraction is the practice of reducing inter-dependency between methods.  
 // The following is an unreasonably simple example, but the point stands: 
 // don't make the person on the other side of your function do more work 
 // than they need to.  Include all necessary data transformations in your 
 // methods as is.  For instance, take method GetAreaOfCircle: 

 // Good practice: 
float GetAreaOfCircle(float radius) {
	return 3.14f * radius * radius;
}
int main() {
	printf("%d", GetAreaOfCircle(3.0f));
    getch();
    return 0;
}

 // Bad practice: 
float GetAreaOfCircle(float radius) {
	return radius * radius;
}
int main() {
	float area = 3.14f * GetAreaOfCircle(3.0f);
	printf("%d", );
    getch();
    return 0;
}
Posted by: Guest on December-30-2020

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language