Core java interview question
109. What is the difference between an if statement and a switch statement? The if statement is used to select among two alternatives. It uses a boolean expression to decide […]
109. What is the difference between an if statement and a switch statement? The if statement is used to select among two alternatives. It uses a boolean expression to decide […]
103. What is the difference between a public and a non-public class? A public class may be accessed outside of its package. A non-public class may not be accessed outside
97. What are the legal operands of the instanceof operator? The left operand is an object reference or null value and the right operand is a class, interface, or array
91. Name the eight primitive Java types. The eight primitive types are byte, char, short, int, long, float, double, and boolean. 92. What restrictions are placed on the values of
85. Is null a keyword? The null value is not a keyword. 86. Which characters may be used as the second character of an identifier, but not as the first
85. Is null a keyword? The null value is not a keyword. 86. Which characters may be used as the second character of an identifier, but not as the first
79. What are order of precedence and associativity, and how are they used? Order of precedence determines the order in which operators are evaluated in expressions. Associatity determines whether an
73. What do you understand by private, protected and public? These are accessibility modifiers. Private is the most restrictive, while public is the least restrictive. There is no real difference
67. Which class is extended by all other classes? The Object class is extended by all other classes. 68. Which non-Unicode letter characters may be used as the first character
61. What value does read() return when it has reached the end of a file? The read() method returns -1 when it has reached the end of a file. 62.
55. Why does Java not support operator overloading? Operator overloading makes the code very difficult to read and maintain. To maintain code simplicity, Java doesn’t support operator overloading. 56. Can
49. Why is an Interface be able to extend more than one Interface but a Class can’t extend more than one Class? Basically Java doesn’t allow multiple inheritance, so a
43. Can a abstract class be defined without any abstract methods? Yes it’s possible. This is basically to avoid instance creation of the class. 44. Class C implements Interface I
37. What is the importance of static variable? static variables are class level variables where all objects of the class refer to the same variable. If one object changes the
31. Can you give few examples of final classes defined in Java API? java.lang.String, java.lang.Math are final classes. 32. How is final different from finally and finalize()? final is a
25. Can a class declared as private be accessed outside it’s package? Not possible. 26. Can a class be declared as protected? The protected access modifier cannot be applied to
13. What are instance variables? Instance variables are those which are defined at the class level. Instance variables need not be initialized before using them as they are automatically initialized
7. What is the base class of all classes? java.lang.Object 8. Does Java support multiple inheritance? Java doesn’t support multiple inheritance. 9. Is Java a pure object oriented language? Java
Junior Engineer (Chemical) Hiring Organisation: GAIL (India) Limited Salary: INR Rs.16,300 – 38,500/- Address: GAIL Bhawan, 16, Bhikaiji Cama Place, R K Puram New Delhi Delhi 110066 Education Requirements: Full-time
13. What are the advantages of cloud services? Some of the advantages of cloud service are given as follows: Helps in the utilization of INVESTMENT in the corporate sector; and
7. What is the AppFabric component? The AppFabric component is used to create access control and distribute messages across clouds and enterprises. It has a service-oriented architecture, and can be
1. What is cloud computing? The cloud computing is the computing which is completely based on the Internet. It can also be defined as the next stage in the evolution
19. Which utility allows you to reference an assembly in an application? An assembly can be referenced by using the gacutil.exe utility with the /r option. The /r option requires
13. What is the significance of the Strong Name tool? The Strong Name utility (sn.exe) helps in creating unique public-private key pair files that are called strong name files and
7. Is versioning applicable to private assemblies? No, versioning is not applicable to private assemblies as these assemblies reside in their individual folders. Versioning can be applied to GAC only.