- Q. what is an object?
A.object is anything that is really exists. - Q. what is a method and class?
A.class is a blue print/ group name /collection of objects. method represents group of statements that perform a task and it is reusable component. - Q. What is the difference between String and Array
A.String it is a collection of characters. Array is a collection of elements which are same types examples are integer/float/double array ex:int[]a={10,12,3,13}; - Q. How to split a string
A.By using split() method we can split the string but it returns String array. String[] str1=str.split(" ") - Q. What is Overloading
A.Writing two or more methods in a class in such a way that each method having the same name with different parameters is called Overloading - Q. What is Overriding
A.Writing two or more methods in super class and sub class such a way that each method has same name and same signatures and same return types. - Q. What is Inheritance
A.acquiring(copying) properties and methods from one class to another class. - Q. How to Reverse string with out using reverse method
A.String str="Nagesh";for (int i = str.length()-1; i >= 0; i--) {System.out.println(str.charAt(i));} - Q. What is Encapsulation
A.
Sunday, December 22, 2013
Subscribe to:
Post Comments (Atom)
TestNG - Can i use the 2 different data providers to same @test methods in TestNG?
public Object [][] dp1 () { return new Object [][] { new Object [] { "a" , "b" }, new Obje...
-
package programs; public class CalculateSumOfNumbersOfArray { public int calculateSumOfNumbers(){ int[] a = {10,20,30,40}; int ...
-
public Object [][] dp1 () { return new Object [][] { new Object [] { "a" , "b" }, new Obje...
-
package programs; import java.util.Scanner; public class ReverseNumber { public void reverseNumber(){ Scanner scn = new ...
No comments:
Post a Comment