Posts

Collections interview questions

why collectoion is introduced into the market? how to sort elements in alphabetical order? what is the difference between collection and collectons? different concepts of collections? what is the difference between set and list? what is the difference between list set and map? what is the difference between hashset and linlkedlist? what are the types of iterators presrent in the collections? difference between linkedlist and hashmap? what is queue? waht is the difference between treeset and linked hashset? what is difference betwen treemap and hashmap? what is the differnce between vector and arraylist? difference between iterator and listiterator? what is sortedset and tailset and headset?

Java Theory interview questions

difference between class and object? what  are class variables and local variables? what is the difference between static and final ? what are the modifiers present in java? what are access modifiers and non access modifieres? what about static block? why we use static block? what about try catch block? can we write try without catch? what is finally block in java? how many catch blocks we can write for one try block? what is tyhe difference between final and finally and finallyze? what is the use of constructor in java? what is the use super key word in java? what is the use of the this keyword in java? what is the use of this keyword in constructors calling? what is wrapper classes? Difference between throw and throws and throwable? difference between string and string buffer and string builder? can we overload a constructor? what is inheritance? different types of inheritance? what is polymorphism? different types of polymorphism? what is abstraction? w...

Tooltip

Image
Tooltip shows title regarding to the the link we can get the information by getattribute of the element then we will get the information.

java programmes frequently asked in interview

1.print duplicate characters of the string? 2.check two string are anagram are not? 3. programme to count number of words in a string? 4.number of occurences of a given character in a string without loop? 5.reverse a string in 3 ways? 6.remove all white spaces from string? 7.find non repeated character from string? 8.reverse stringg using iteration and recursion? 9.string contains only digits are not? 10. reverse a string with preserving spaces psition ? (output:     illa purap udianivaR ) 11.reverse a each word of string ? 12.count no of vowels and consonants in a string? 13.. String to integer and integer to string? 14.All permutation of string ? 15.String is palindrome? 16.remove duplicate characters from string? 17.append astring to text file? 18.if string another string are not? 19.remove given characters from sring? 20.sort string in java? 21.nost repeatedwords in atext file? 22.first repeated character and non repeated character in a string? ...

java programmes Answers for the questions above.

1. Print duplicate characters from string? sol .          public  void  findduplicaearray() { String str="abbcccdddd"; Map<Character,Integer>mp=new HashMap<>(); Map<Character,Integer>dupl=new HashMap<>();         for(int i=0;i<str.length();i++){ if(mp.containsKey(str.charAt(i))){    int count=mp.get(str.charAt(i));                     count++;        mp.put(str.charAt(i),count);} else{ mp.put(str.charAt(i),1); } }         Set<Map.Entry<Character,Integer>>set=mp.entrySet();         for(Map.Entry<Character,Integer>st:set) {         if(st.getValue()>1) {         dupl.put(st.getKey(),st.getValue());                 }     ...

waits

implicitwait : implicit wait syntax is " driver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);" and it is useful for every element which is opened by driver instance and if the element is not finded it will wait until the time we given explicitwait it is the wait which is useful for particular element which will take much time to load so that type of elements it will use webdriverwait wait=new webdriverwait( WebDriver reference ,20); wait.until(Expectedconditions.alert is present); so this is about explicit wait fluentwait: this is the wait whih is useful for the particular element which will take much time to load  so that it will take action for particular time and wait and again do the action and ignore the class Wait wait = new FluentWait(WebDriver reference) .withTimeout(timeout, SECONDS) .pollingEvery(timeout, SECONDS) .ignoring(Exception.class);

Actions

Actions action=new action(driver); clickAndHold() Clicks (without releasing) at the current mouse location. contextClick() Performs a context-click at the current mouse location. (Right Click Mouse Action) doubleClick() Performs a double-click at the current mouse location. dragAndDrop(source, target) Performs click-and-hold at the location of the source element, moves to the location of the target element, then releases the mouse. Parameters: source- element to emulate button down at. target- element to move to and release the mouse at. dragAndDropBy(source, x-offset, y-offset) Performs click-and-hold at the location of the source element, moves by a given offset, then releases the mouse. Parameters : source- element to emulate button down at. xOffset- horizontal move offset. yOffset- vertical move offset. keyDown(modifier_key) Performs a modifier key press. Does not release the modifier key - subsequent interactions may assume it's kept pressed. Parameters : modifier_key ...