Loading
View RSS Feed

shubhangi das

TCS ILP PAT TEST on Java

Rating: 3 votes, 4.33 average.
1.Which of the following statements is false about objects?
a.An instance of a class is an object
b.Objects can access both static and instance data
c.Object is the super class of all other classes
d.Objects do not permit encapsulation
2.Which methods can access to private attributes of a class?
a.Only Static methods of the same class
b.Only instances of the same class
c.Only methods those defined in the same class
d.Only classes available in the same package.
3.What is an aggregate object?
a.An object with only primitive attributes
b.An instance of a class which has only static methods
c.An instance which has other objects
d.None of the above
4.Assume that File is an abstract class and has toFile() method. ImageFile and BinaryFile are concrete classes of the abstract class File. Also, assume that the method toFile() is implemented in both Binary File and Image File. A File references an ImageFile object in memory and the toFile method is called, which implementation method will be called?
a.Binary File
b.Image File
c.Both File and Binary Files
d.None of the above
5.A class can have many methods with the same name as long as the number of parameters or type of parameters is different. This OOP concept is known as
a.Method
b.Invocating
c.Method
d.Overriding
e.Method Labeling
f.Method
g.Overloading
6.Which of the following is considered as a blue print that defines the variables and methods common to all of its objects of a specific kind?
a.Object
b.Class
c.Method
d.Real data
e.types
7.What are the two parts of a value of type double?
a.Significant Digits,
b.Exponent
c.Length, Denominator
d.Mode, Numerator
8.After the following code fragment, what is the value in fname?
Code:
String str;
int fname;
str = "Foolish boy.";
fname = str.indexOf("fool");
a.2
b.-1
c.4
9.What is the value of ‘number’ after the following code fragment execution?
Code:
int number = 0;
int number2 = 12
while (number < number2)
{number = number + 1;
}
a.5
b.12
c.21
d.13
10.Given the following code snippet;
Code:
int salaries[];
int index = 0;
salaries = new int salaries[4];
while (index < 4)
{
salaries[index] = 10000;
index++;
}
What is the value of salaries [3]?
a.4000

b.5000

c.1500

d.1000

12.Which of the following is not a return type?
a.boolean
b.void
c.public
d.Button
13.If result = 2 + 3 * 5, what is the value and type of ‘result’ variable?
a.17,byte
b.25, byte
c.17, int
d.25, int
14.What is the data type for the number 9.6352?
a.float
b.double
c.Float
d.Double
15.Assume that the value 3929.92 is of type ‘float’. How to assign this value after declaring the variable ‘interest’ of type float?
a.interest = 3929.92
b.interest = (Float)3929.92
c.interest = 3929.92(float)
d.interest = 3929.92f

Submit "TCS ILP PAT TEST on Java" to Digg Submit "TCS ILP PAT TEST on Java" to del.icio.us Submit "TCS ILP PAT TEST on Java" to StumbleUpon Submit "TCS ILP PAT TEST on Java" to Google

Comments

Page 1 of 2 12 LastLast
  1. mit2591's Avatar
    Thnx a lot :)
  2. rockingadarsh's Avatar
    thanks.....
  3. rockingadarsh's Avatar
    please tell me about test at ILP.
  4. seshu.datla's Avatar
    thanx alot n plz post ans for java n unix
  5. shubhangi das's Avatar
    ohkay i will definetely be working
  6. angad's Avatar
    do check this for documents ,materials and process of joining.
    ONE CLICK : TCS PRE ILP ASPIRE Materials,documents and post ILP stuffs for all groups.

    http://techforum4u.com/entry.php/124...for-all-groups.
  7. piyush's Avatar
    plz share answer for java test.........
  8. saranya's Avatar
    thanks alot.. plz post ans for unix n java...
  9. lisa's Avatar
    BT WHERE R D ANSWERS?
  10. doogkiciye's Avatar
    Dear all what we r waiting is something inside u so i hope someday all of us will be enjoying the answers as soon as possible
  11. swetasharma.ei@gmail.com's Avatar
    provide us answers soon....
  12. lisa's Avatar
    hope d soon comes SOON............
  13. jskandhari's Avatar
    Thanks.. any answers ;) :P
  14. payel1's Avatar
    plzz post d ans....
  15. tejassarwajna's Avatar
    Answers:
    1.d
    2.c
    3.c
    4.d
    5.g
    6.b
    7.b
    8.b
    9.b
    10. I think question is wrong.
    12.c
    13.a&c
    14.a
    15.d

    If anything is wrong, please let me know.
  16. anushathakellapati's Avatar
    1.d,2.c,3.c,4.b,5.method overloading,6.b,7.a,8.b,9.b,10.d,12.d,13.c,14.a&c,15.d..
    i think..
    please tell me if anythin wrong
  17. Dileep's Avatar
    i think correct choice for question 14 is d ie double because in java if u don't write f at the end of the number it will be taken as double type not float type
  18. Dileep's Avatar
    and please justify the answer for question number 8
  19. anushathakellapati's Avatar
    for ques 8. in the initialization part foolish boy is given in caps and asked to find of fool which is not in caps...for further reference check out function of the above string function in google search
  20. anushathakellapati's Avatar
    yes
    its double for q.14
Page 1 of 2 12 LastLast



Disclaimer: Users of techforum4u.com are responsible for ensuring that any material they post (article, blog posts, images or other mulitimedia content) does not violate or infringe upon the copyright, patent, trademark, or any personal or proprietary rights of any third party, and is posted with the permission of the owner of such rights.Anyone who violates these rules may have their access privileges removed without warning.