Creating Pivot chart for ALM reporting.

How we created our automation progress  report from ALM to Email in 30 minutes?

Requirement:-
We need to showcase our management regarding the  progress in Automation.So rather than giving them quantitative data we thought of sharing it in more presentable manner using Pivot charts.

Hope it help our fellow automation friends in creating easy and rapid reports.
Please feel free to share Your experience as comments, as we always believe sharing is caring.

Do follow us for more updates FB,LinkedIn,G+

Download dummy Excel

Solution:-
Step1:- Getting Data from ALM(Application life cycle management),

Note:- It can vary depending on the management tool which is used in the organization but still the approach would be same.
A)Testing -> Test Plan -> Select the Test Folder -> Live Analysis Tab -> Click on 'Add Graph'

Opening Live Analysis view in ALM

B)Select 'Summary Graph' -> Click Next

Summary Graph creation from ALM

C) Select any value for X-axis field -> Click Finish

Selecting X-axis Field in ALM summary graphs

D)Graphical view would be generated -> Click on the bar graph tower

Live Analysis graph in ALM

E)Drill down Results window opens

Drill down results ALM

This is what we were waiting for, we can change what all the columns we need in our report.Further we would export the report in Excel format.


Select columns in Drill down results
Selecting columns in Drill down results view

Export Excel from ALM
Exporting excel from Drill down results


Step2:-Creating Pivot Chart
A)We have our required data in Excel,we can edit to make any required changes like headers or any other modification.
B)Insert -> Pivot Chart

Opening Pivot Chart in Excel

C)Select the Table/Range for Pivot Chart -> Click Ok

Create Pivot Table, range selection Excel

D)Select from "Pivot Chart" Fields, the columns that we need to displayed in Pivotchart report
Pivot chart in Excel

Check the two variations of graph when we changed the data under Axis and Values.



Selecting Pivotchart fields in Excel
Pivot chart view-1





Pivot Chart view-2


Step3 :- Playing with the design of the Pivot chart
One's our chart is ready we can change the color or display design (Like pie chart) to make it look more impressive and easy to comprehend

Just select chart -> click on brush


Changing color in pivot chart



Changing chart styles in Pivot chart



We can also change the shape of graph, INsert -> Charts -> Select the chart option as suitable(Do select the chart below to check the live effect)


Selecting different chart styles in pivot charts Excel



ReRun ALM test
Log BUG in ALM using OTA
Learn Selenium

How to Select random value from a DropDownList using Selenium or UFT

Requirement:- We need to select random value from a given dropdownlist, to test the functionality how our AUT would behave under varying selection of options.
Application Link:http://www.ufthelp.com/p/testpage.html
DropDownlist for random selection Selenium
DropDownlist + HTML code

Approach:-
1.We would take the count of existing options in the weblist/dropdownlist .
2.Take a random value between 0(starting index of the dropdownlist, we can avoid in our case as we have --Select-- at 0 index) and maximum value -1(total available options in the list)
3.Select the value based on the random value

Same logic would work whether we are using Selenium or UFT as our testing tool.

Solution:-
(Selenium)
1.How to take count of items:-
a.We can use Findelements method to return a list of items and further we would use getSize method of list to fetch the count value.
//Creating the List object
List <WebElement> weblist = driver.findElements(By.xpath(".//*[@id='drpdwnTopics']/option"));
//Taking the count of items
int iCnt = weblist.size();

b.We can use the Select Class and implement its getOptions method to get the count.
Select objSel = new Select(driver.findElement(By.xpath(".//*[@id='drpdwnTopics']")));
List <WebElement> weblist = objSel.getOptions();
//Taking the count of items
int iCnt = weblist.size();

2.How to generate random number, we would implement "Random" class and use its nextInt method to output the random number between the given range.
Note:- nextInt, method would generate number from 0 to upperlimit-1, example nextInt(10), would generate numbers between 0 and 9.

Code
import java.util.List;
import java.util.Random;
import java.util.concurrent.TimeUnit;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.support.ui.Select;
import org.testng.annotations.*;


public class RandomSelectionDrpDwnList {
 WebDriver driver;
 @BeforeTest
 public void launch()
 {
  driver = new FirefoxDriver();
  driver.get("http://www.ufthelp.com/p/testpage.html");
  driver.manage().window().maximize();
  driver.manage().timeouts().implicitlyWait(20000, TimeUnit.MILLISECONDS); 
 }
 
 @Test
 public void selectRandom()
 {
 //Object of the Dropdownlist
 WebElement drpDwnList = driver.findElement(By.xpath(".//*[@id='drpdwnTopics']"));
 //Using FindElements to create a List object
 //List <WebElement> weblist = driver.findElements(By.xpath(".//*[@id='drpdwnTopics']/option"));
 //Using Select Class to fetch the count
 Select objSel = new Select(drpDwnList);
 List <WebElement> weblist = objSel.getOptions();
 //Taking the count of items
 int iCnt = weblist.size();
 //Using Random class to generate random values
 Random num = new Random();
 int iSelect = num.nextInt(iCnt);
 //Selecting value from DropDownList
 objSel.selectByIndex(iSelect);
 //Selected Value
 System.out.println(drpDwnList.getAttribute("value"));
 }
 
 @AfterTest
 public void close()
 {
  //Closing the browser
  driver.quit();
 }
 
}

(UFT)
1.For taking count of items, we would use GetRoProperty in UFT and pass "all items" to fetch the count 
2. Random number is a Utility object , which generates random number between the given range

Code
'Random number is a Utility object , which generates random number between the given range
Dim obj
Set objList = Browser("creationtime:=0").Page("creationtime:=0").webList("html id:=drpdwnTopics")
fnSelectRandom objList

'*****************Fynction***************************************************
'Function Name:-        fnSelectRandom
'Function Description:- Function to Select Random Value from DropDown
'Input Parameters:-    objList(WebList)
'Output Parameters:-    None
'****************************************************************************
Sub fnSelectRandom(objList)
 Dim iCnt,iRandom,sSelValue
 'Getting the item count of dropdown
 iCnt = objList.GetROProperty("items count")
 'Taking the Random range between 0 and items of Dropdown
 iRandom = RandomNumber(0,iCnt-1)
 'Selecting the value
 objList.Select "#" & iRandom
 'Taking the Selected Random Value
 Print "Selected Value = "&objList.Object.value
End Sub

More Examples
Learning Java 
Learn UFT

Array in Java

What is an Array?
An array is storehouse or we can say collection of similar type of data type.
It is a data structure where we store similar elements. We can store only fixed set of elements in a java array(solution is ArrayList) unlike vbscript where we can have dynamic arrays using Redim keyword.

"Stop being in LOVE with someone who never was and focus on the one who IS". If you Love learning new concepts,Do follow us on FB , G+ , Twitter, or Linkedin

Why Arrays?
It provides code optimization and easy access. Like Instead of declaring individual variables, such as Learn0, Learn1, ...Learn9, we can declare one array variable and use Learn[0], Learn[1], ..., Learn[9] to represent individual variables.

Syntax:-
dataType[] arrayName;

or

dataType arrayName[];

or

dataType []arrayName;
Memory allocation of Java Array
Memory allocation of an Array


Example:- 
We are declaring an integer array by implementing the above syntax


public class ArrayInJava {
//Array Delcaration in Java
 public static void main(String[] args) {
  //Approach1
  int[] Learn;
  //Approach2
  int Revise[];
  //Approach3
  int []implement;
 }

}

Assigning a Value :-
We have declared an array, now how can add value into the reserved memory locations of an array like Learn[0] should have 100.
Heap Memory after Array value allocation in Java

Approach1:-
dataType[] arrayName = new datatype[arraysize];
arrayName[0] = arrayValue;
arrayName[1] = arrayValue;
-
-
-
arrayName[arraySize-1] = arrayvalue;

Approach2:- 
dataType[] arrayName = {value1,value2,...value10}

Example:-
public class ArrayInJava {
//Assigning values to Array in Java
 public static void main(String[] args) {
   //Approach1
  int[] Learn = new int[2];
  Learn[0] = 100 ;
  Learn[1] = 200 ;
   //Approach2
  int Revise[] = {100,200};
 //Accessing element of an Array
  System.out.println("Approach one Result ="+Learn[0]+";"+Learn[1]);
  System.out.println("Approach Two Result ="+Revise[0]+";"+Revise[1]);
 }

}
#Output:-
Approach one Result =100;200
Approach Two Result =100;200
Note:-
Array index always starts with 0 , thus to access the first element we used ArrayName[0].

HandOn:-
Example1:- 
We have used for loops in working with Arrays.
public class ArrayInJava {
//Working with Arrays Using For Loops
 public static void main(String[] args) {
   //Declaring an Array
  int[] Learn = new int[10];
   //Assinging values to an Array Using For loop
  for (int iCnt = 0 ;iCnt<Learn.length;iCnt++){  
   Learn[iCnt]=100+iCnt;
   //Taking the output
   System.out.println(Learn[iCnt]);
  }
 }
}

#Output:-
100
101
102
103
104
105
106
107
108
109

Example2:- Passing an  Array to a method and Taking return type also as an Array(This is also an example how we can receive multiple return values from an function)
public class ArrayInJava {
//Passing and Reciveing an Array from a method
 public static void main(String[] args) {
   //Declaring an Array
  int[] Learn = new int[10];
   //Assinging values to an Array Using For loop
  for (int iCnt = 0 ;iCnt<Learn.length;iCnt++){  
   Learn[iCnt]=100+iCnt;
  }
  
  //Calling a method to add 1 to all the array values
  int[] FinalRes = returnArray(Learn);
  //Taking the output of an array
  for (int iCnt = 0 ;iCnt<FinalRes.length;iCnt++){
   System.out.println(FinalRes[iCnt]);
  }
 }
 
 public static int[] returnArray(int[] res){
  //Adding 1 to each value of an Array
  for (int iCnt = 0 ;iCnt<res.length;iCnt++){  
   res[iCnt]= res[iCnt]+1;
  }
  //Returning an Array Value
  return res;
 }
}

#Output:-
101
102
103
104
105
106
107
108
109
110

Note:- We can use Array.sort(ArrayName); to sort values in a Array.

Multidimensional Arrays:-
Data is stored in the form of rows and columns like a matrix or they way we access the elements of an excel cell A1, B1 ....

Syntax:-
dataType[][] arrayName;

Example:-
int[][] Learn=new int[4][4];//4 row and 4 column

Q&A:-
1.What is the difference between char c[] and char[] c in array declaration ?
A. In Java, both are legal and equivalent.First style is preferred declaration and second is  how arrays were declared in C , so it was included for the convenience of programmer moving from c/c++ to Java

2. What is the starting index of an Array in JAVA/vbscript and Why?
A. Starting index is always "0".This convention originated with machine-language programming, where the address of an array element would be computed by adding the index to the address of the beginning of an array. Starting indices at 1 would entail either a waste of space at the beginning of the array or a waste of time to subtract the 1.

3. What happens if we use a negative number(index) to access an array?
A. Whenever we attempt to index an array with an index that is not between zero and the array length minus one, Java will issue an ArrayIndexOutOfBoundsException and terminate the program.

Exploring Data Type & Variables in Java

Java is a strongly typed programming language unlike Vbscript,Perl.In novice terms it means that all the variables in the Java programming language ought to have a particular data type.

Example we cannot use a variable say "xyz" in the code before declaring this like:- String xyz;

What is a Variable?
Variable is the name given to the reserved area allocated in the memory.So we are creating a  variable,we are blocking a  new address space with a unique name.
Syntax:-
Variable Type Variable Name;
Example:-
String Learn;
Where String = Variable Type , Learn = Variable Name.

Variable Type :- it gives what the variable can and cannot hold, as above variable "Learn" can store "String" data.
Variable Name:-Unique name to access the variable.

Note:-
1.We can declare and assign value to a variable in one go or in two steps,
Example1:
String Learn = "java";
 or 
String Learn; Learn = "java";
Example2:-
(Grouping):- 
String Learn = "java", Revise = "selenium"; 
or 
String Learn,Revise; 
Learn = "java";
Revise = "selenium"
2.Naming conventions for variable Name :-

  • Spaces are not allowed in the Name
  • Characters allowed are A-Z and a-z(small case)
  • Numbers (0-9)
  • Special Characters Only $ and _(underscore) are allowed 
  • Name cannot begin with a number but above special characters are allowed.
  • Reserved keyword in java are not allowed as variable name like new,for,case,continue...
What is a Data type?
Data type specifies the size and the type of values that can be stored in an variable name.

Types :- 
Primitive & Non primitive.

Primitive type is the default data type in Java language and they come with predefined  number of operations.We can not define a new operation for such primitive types.

Following 8  data types are marked as primitive.


Primitive data type Java
Primitive Data Type
Code:-
public class DataType {
   public static void main (String[] args)
   {
     System.out.println("Size of byte: " + (Byte.SIZE/8) + " byte.");
     System.out.println("Size of char: " + (Character.SIZE) + " bits.");
     System.out.println("Size of short: " + (Short.SIZE) + " bits.");
     System.out.println("Size of int: " + (Integer.SIZE) + " bits.");
     System.out.println("Size of long: " + (Long.SIZE) + " bits.");
     System.out.println("Size of float: " + (Float.SIZE) + " bits.");
     System.out.println("Size of double: " + (Double.SIZE) + " bits.");
     System.out.println("Size of Boolean: -- bits.");
   }
}

##Output:-
Size of byte: 1 byte.
Size of char: 16 bits.
Size of short: 16 bits.
Size of int: 32 bits.
Size of long: 64 bits.
Size of float: 32 bits.
Size of double: 64 bits.
Size of Boolean: -- bits.

How the range of a Data Type is assigned:-
Like why byte datatype range starts from -128 to 127.
In our above diagram we associated a particular range set with a given data type , say Int is 4 byte(32 bit) but how this is computed.We would go into our school days to comprehend this process.

Computer memory store numbers in the form of binary system(meaning 0 or 1). And our memory is like a grid of cell.Now each cell contains binary data(in the form of 0 or 1 called as bit).

Memory data cell

Our data flow in the form of 8 bits meaning we have 8 places to put our bits , thus incase we make them all 1 in each cell it comes as (1111111 in binary ) which is equivalent to 255 in decimal system.Further to take the minimum we can have all bits have 0 each. So the number from 0 to 255 can fit the 8 bits.
Data Range for a Byte in Java

Out of this 8 bits one bit is reserved for holding the sign of a number(positive or negative) so we are left with 7 bits , thus maximum  7 bits can hold is (1111111 = )127 in decimal system.Similarly for minimum values we have 7 bits of 000000 and 1 bit for sign which comes as(10000000) - 128 in decimal system.
Byte Data Type in JAVA

So our 8 bits can hold numbers ranging from -128 to 127(including 0) or a total of 256 numbers.

Non primitive (Reference type) :- classes(String Class) , arrays.

Primitive v/s Reference type:-
For a variable of a primitive type, the value of the variable is stored in the memory location assigned to the variable. So, if an integer variable is declared as “int days = 100″, then when we look at the memory location of “days”, "100" would be  stored there just as expected.

However, a variable of a class type(Non Primitive) only stores the memory address of where the object is located – not the values inside the object. So, if we have a class called “learn selenium”, when we create an object(say obj) and if check the this object in memory, we will see that it does not store any of the variables that belong to that object in memory.

Instead, the variable “obj” just stores an address of another place in memory.This means that the object named by the variable is stored in some other location in memory and the variable contains only the memory address of where the object is stored. This memory address is called a reference to the object.

Example :- 
str = new String("example of reference"), it would work like :-
1.Evaluate the expression , new String("example of reference")
this expression creates an new object, which creates an reference to an object which decriobes its location in memory.
2.Store the value in the variable (str)
str= The reference to string created

Now whenever the program needs to refer to the object it uses the variable str.And str contains the reference of memory location where string exists.

How to get variable type in Java?
Non Primitive Type:- 
We can directly get it by using getClass() and getSimpleName() methods.
package Java;
public class DataType {
 public static void main(String[] args) {
 //We have a variable
 String Learn = "Selenium";
 //Lets check Class of Variable
 System.out.println("Class = "+ Learn.getClass());
 //Lets check Type of Variable
 System.out.println("Type="+Learn.getClass().getSimpleName());
  }
}

Primitive Type
We need to create the object of Datatype to use the above methods.
package Java;
public class DataType {
 public static void main(String[] args) {
 //We have a variable
 int noOfDays = 365;
 //Create object
 Object obj = noOfDays;
 //Lets check Class of Variable
 System.out.println("Class = "+ obj.getClass());
 //Lets check Type of Variable
 System.out.println("Type="+obj.getClass().getSimpleName());
  }
}
How to find Datatype of Primitive variables
Output of Int DataType

Meaning of Arrays in Java

Key Components of JAVA

JDK, JRE and JVM are core concepts of Java programming language. As a novice in this language we should try to comprehend these concepts to visualize how it works logically.

For more updates do follow us on Facebook,Twitter or Google+

JDK and JRE n Java

Java Development Kit (JDK) consists of tools needed to create the Java programs,like Java libraries, Java compiler(javac.exe), Java debuggers, bundling and deployment tools.It also contains the JRE to run the java programs.We need to install the platform specific JDK like for windows,linux.We did installed the JDK while understanding the prerequisites for Selenium.

In nutshell JDK,is required to create our own java programs and to compile them as bytecode.Further we need JRE only for running the programs.

Javac:- Meaning Java Compiler,which takes programming code(java) as input and produces an executable code(bytecode) as an output.This is further executed by JVM into native code (machine code) as per the platform(windows,linux,mac,solaris)

ByteCode:-It is stored in .class file and cannot be read by standard CPU's and needs to be translated into an instruction language that the underlying execution platform(Windows,linux) can comprehend.

JRE:-
we must have experienced this thing that while trying to run any  java application on browser or in mobile,browser often suggest to download the JRE to run the program.

Thus JRE is targeted for execution of Java files i.e. JRE = JVM + Java Packages Classes( like math, lang, awt,swing etc)+runtime libraries. Java code comes in the bundled form of JAR  (Java archive) files(remember we also used selenium JAR files to create test scripts)and we require Java virtual machine JVM to execute it.JRE is again platform dependent like JDK

JVM:-
JAVA virtual machine is the key for converting byte code into machine specific code.Moreover we have multifarious JVM as per the operating system like for Windows, Linux or Mac but one JAR(byteCode) can run on all these operating systems. 

Java Virtual machine is at heart of Java programming language and provide several features  to Java programmer including Memory Management and Garbage Collection, Security and other system level services.

JVM is the backbone of the "write once and run everywhere" principle in JAVA

Summary:-
1)  Both JDK and JRE come as installer while JVM are bundled with them.
2)  JRE only contain environment to execute java program but doesn’t contain other tool for compiling java program like JDK. In short JDK is for development purpose whereas JRE is for running of java programs.If we only need to run the Java code then JRE is recommended option but for full fledge development package JDK is preferred option.
3) JVM comes along with both JDK and JRE , it is like heart of java programming language and provides platform independence.

Note:-
1)JIT (Just in Time) or dynamic compilation is part of JVM that optimizes bytecode to machine specific language compilation.
What happens is:- An JVM interpreter generates and executes the machine code instructions on the fly for each instruction, regardless of whether it has previously been executed.Now JIT caches the instructions that have been previously been interpreted to machine code, and reuses those native machine code instruction thus saving time and resources by not having to re-interpret statements that have already been interpreted by compiling similar bytecodes at same time, hence reducing overall time taken for compilation of bytecode to machine specific language.

2)Eclipse IDE comes with its own java compiler , it is different from javac, like it allows to run the code that did not actually properly compile and incase the error code block is never ran, our program would run fine.Further it comes with incremental feature, which allows our code to be pre-compiled as soon as we are finish typing.

Introduction to JAVA
DataType in Java

Introduction to JAVA

Have faith, love and courage to learn and share with others.That is what we at uftHelp believe in.

We are starting this series of tutorials with focus on JAVA programming language.Do follow us on Fb,G+,Twitter for more updates.

History:-
It kick-started in 1991, when a group of Sun Microsystem engineers team (called as Green Team, led by James Goslingput up their efforts to create a language for digital devices such as set-top boxes, televisions etc.Initially it was as named “Oak”(The name Oak was used by Gosling after an oak tree that stood outside his office.) but as this was the trade mark of Oak Technologies, new name JAVA came into existence.

The first publicly available version of Java (Java 1.0) was released on 27 May,1995.After that it became the most popular programming languages,and knowingly or unknowingly it is integral part of our daily lives --from mobile phones to handheld devices, games and navigation systems to e-business solutions, Java is everywhere--

Sun Microsystems was later acquired by the Oracle Corporation in 2010.

We can check and download the latest version of Java.

Key Features:-

object oriented:-Apart from  primitive data types(like int,Boolean), all elements in Java are objects.

platform independent: Java programs use the Java virtual machine(JVM) to run the java program on the operating system directly. This makes Java programs highly portable.Thus making the code run on  Windows or Linux.

interpreted and compiled language: Java source code is transferred into the bytecode format which does not depend on the target platform. Further JVM interprets these bytecode instructions and translates them into native code
instructions which can be understood by operating system.

Strongly-typed programming language: Contrary to  VbScript which is loosely typed, Java is strongly-typed,i.e. we need to declare the variable before using it and conversion to other objects is relatively strict,like it must be done in most cases by the programmer.

automatic memory management: Java manages the memory allocation and de-allocation for creating new objects. The program does not have direct access to the memory. This feature of garbage collector automatically deletes objects to which no active pointer exists.

Write Once Run Anywhere!!
Java is known as platform independent why? Because It has the ability to run the same program on many different hardware configurations and operating systems.

This is possible because of JVM.It  makes Java as a portable and platform independent language.

Java Virtual Machine
When the Java code is compiled, an intermediate code state is created called as the bytecode.This bytecode is then converted to Machine code (Native code) by JVM.

The JVM varies across platforms,But the bytecode generated by the compiler is same everytime.The JVM performs the function of handling the bytecode and producing executable code in the form as is understood by the platform on
which we are working on.This is the reason that java is called as "Write Once Run Anywhere".

Note:-
  • The bytecode is platform independent but the machine code generated by JVM is platform dependent. JVM forms the Java Runtime Environment (JRE) for the program execution. Each operating system and CPU architecture requires a different JRE.
  • The Java virtual machine is called "virtual" because it is an abstract computer (that runs compiled programs) between the compiled Java program and used hardware and operating system.It loads the  appropriate class files for executing a Java Program, and then to execute it.
JRE v/s JDK v/s JVM
Learn Selenium
More Java Tutorials


Static Keyword in Java

What is Static Keyword in Java?

Static means a field or an method that belongs to the class, rather than to an instance of the class.In simple terms, it means that we can call a static method/field even without creating the object of a  class to which they belongs!.We can have a static method or a static variable.

We have used this concept in our public static void main(String[] args), while using this we never created the object of main method but instead Java virtual machine can call the main method without creating a new application object.

Note:- we cannot use Static with class unlike final keyword.
illegal modifier error on creating static class
Static class is not possible!!

How to access static method/Variable

Syntax:-
ClassName.StaticMethod/Variable Name

Example:-
We would be accessing the static method of class(StartURL) using StartURL.testURL();

Accessing static method by its name in java

Code:-
package Java;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;

public class StartURL {
 //Creating Static variable
 private static WebDriver driver;
  //Creating an Static Method
 public static void testURL(String sURL)
 {
  driver = new FirefoxDriver();
  driver.get(sURL);
  System.out.println("Inside Static Method");
 }
 
}
package Java;

public class MainTestCase extends StartURL{

 public static void main(String[] args) {
  //Accessing the Static method without 
  //creating class object
  StartURL.testURL("http://www.uftHelp.com");
 
 }

}


Note:- We can still access the static method or variable by using the instance object of the class, but this is not a good coding practice.In above case we could have done it using :-  
 public static void main(String[] args) {
  //Accessing the Static method  
  //By creating class object
  StartURL obj = new StartURL();
  obj.testURL("http://www.uftHelp.com");
} 
 
Still Eclipse or other Java IDE's would generate warning message :-
Static method warning message in Eclipse


Important points:-
1.Static method is associated with a class while non static method is associated with an object.
2.We can use Static + final to create constant value that's attached to a class.
Example:-
package Java;
public class StartURL {
 //Creating Static variable
 final static int noOfDays = 365;
 
 public static void main(String[] args) {
  System.out.println(noOfDays);
 }
}
3.When we create different object of an class, each class contains its distinct copy of instance variable and each is stored in different memory location but incase of static variables, it is shared across the class , which occupies an fixed location in memory.So by using static keyword we are making our program memory efficient.
4.Non static (methods, variables) can not be accessible inside static methods,meaning we can only access  static stuff Inside static methods.
Example:-
Cannot Access non static variable inside a static method of java
Interface in Java