Java coding test questions and answers
Objective Type Q&A(part1)
Array indexes start with?--> A: zero
Which keyword is used to create a class in Java?--> A: class
To declare an array in Java, define the variable type with? --> A: [ ]
Which keyword is used to import a package from the Java API library?--> A: import
Why include comments in Java programs?--> A: clarity of code
Which keyword is used to return a value inside a method? -->A: return
Which statement is used to stop a loop?--> A: break
When does method overloading is determined?--> A: At compile time
Which concept of Java is achieved by combining methods and attributes into a class?--> A: Encapsulation
compile time polymorphism is one type of polymorphism in Java programming.
Method overriding is a combination of inheritance and polymorphism? --> A: true
The value of a string variable can be surrounded by single quotes --> A: false
In Java, it is possible to inherit attributes and methods from one class to another. --> A:true
Does java support constructor overloading? --> A: true
The wrapper objects for the primitive values are immutable --> A: true
An interface can extend more than one interface --> A: true
The java source code can be created using a notepad editor --> A: true
Data hiding makes the data more reliable and reusable --> A: true
If a class is derived by another class then the base class cannot be used independently --> A: false
The process of having methods with same name but having diffrent parameter list and return types is called overloading
Comments
Post a Comment