Posts

QA's approach 2 Java - Methods in Java

Methods in Java: 1. Used to expose the behaviour of the objects 2. Used to perform an action and would or wouldn't return any outcome for that action. Examples: Click() ->Doesn't require any outcome of the action. Display()-> Require the action to display an output to some terminal. GetBalance()->Require the action to fetch the Balance of the customer. Method signature: [With or Without Return type] Method(with or without parameters)  { ------------- --------------- [With or Without Return statement;] } Method Parameters can be of primitive, reference type, variable arguments or array types 1. method(Primitive type)      Display(Int a) 2. method(Reference type)      display(String s)      display(Student s1)      display(Student a[])     display(Object obj[]) 3. method(Collection object) 4. method(String args...) Variable no of arguments passing...

QA's approach 2 Java - Java Naming Conventions

Image
Java Naming conventions

QA's approach 2 Java - Understanding JVM, JRE, JDK

Image
JVM: It interprets byte code into machine code depending upon thee underlying OS and hardware combination It uses the class libraries or packages like util, math, awt, lang, swing, etc.., and other supporting files provide in JRE The JVM is responsible for the following: • Loading, verifying, and executing the byte code • Providing a runtime environment for execution of byte code • Memory management and garbage collection jvm consists of classloader, memory area, execution engine Class Area/Method Area: This is the region where the Execution class gets loaded in the order they are defined. Static Variables gets initialized with default values. Heap Area:  This is the region of memory where objects are stored & memory is allocated for non-static variables. Stack Area:  Order considered for execution of blocks & methods in stack frame as follows: Static blocks, Static main method, Static User defined methods, Non Static blocks, Non ...

QA's approach 2 java - Java Code Execution

Image
Java Code Execution Process. Java Program compilation: javac ClassName.java Java Program   execution : java ClassName Java applications are called WORA (Write Once Run Everywhere). This means a programmer can develop Java code on one system and can expect it to run on any other Java enabled system without any adjustment. This is all possible because of JVM. When we compile a .java file, a .class file(contains byte-code) with the same filename is generated by the Java compiler. This .class file goes into various steps when we run it. These steps together describe the whole JVM. 1. The execution logic class file [class containing main method] will get loaded into method area by class loader sub system Class loader sub subsystem is mainly responsible for three activities. 1. Loading 2. Linking 3.Initialization Loading : The Class loader reads the .class file, generate the corresponding binary data and save it in method area. For each .class file, JVM stores follo...

QA's approach 2 Java- This & Super Keywords

This & Super Keywords this : this is a reference to the current class object.this can be used with respect to variables,methods and classes. It is a keyword. It is a pre-defined non-static variable It holds object reference. It must be used inside the non-static context only. Example 1 class Demo {                 static                 {                                 System.out.println(this); //Compiler error.....                 }                 {    ...

Practical Testing Check List

           Testing Check List This check list comprises of use cases which can be applied to any web application. Thought there are many areas covered but no checklist could cover all the possible checks under the sun. I am sure you would find that many more use cases can be added to this list. So here is the list I could think of - General Validation: - Verify page focus on a field on page load. For example login page would have cursor blinking in user name field - Tabbing may let you bring control on fields and submit form which are supposed to be disabled and. Don’t rely if a field “looks” disabled as it may be exercised using tab key - Verify navigation of toolbar, menu items and fields using tab key. Tab order should be left to right and up to down - Using tab key should not bring control on read only and disabled fields - When brining control on a field then it should stand out by cursor blinking in text box or highlighted field - T...

QA's approach to Java - Understanding Non static context

Image
Non-Static Members Flow Java supports 4 non-static members inside a class 1) non-static block 2) non-static variable 3) non-static method 4) constructor Note : to access these members, object creation is required. Ques : Where we can create object for a class ? Ans : using any one of 4 static members. Generally to access any restricted area(non-static), we need to take permissions in common area(static). for example, to enter into theater(non-static), we need to get ticket in box-office(static) Example: Object created in Static main method class Demo {        int a ; //non-static variable,   must be intialized using constructor         Demo( )                 {                         System.out.println("Constructor....");      ...