
Software Programming : Java Programming QUESTIONS AND ANSWERS :: part12 : 6 to 10
Following Software Programming language Entrance Multiple choice objective type questions and answers will help you in Software Programming 2024 examinations :
6.Suppose you define a Java class as follows: public class Test { } In order to compile this program, the source code should be stored in a file named |
| Test. class |
| Test.doc |
| Test.txt |
| Test. java |
| Any name with extension .java. |
7.To declare a constant MAX_LENGTH as a member of the class, you write |
| Final static MAX_LENGTH = 99.98; |
| Final static float MAX_LENGTH = 99.98; |
| Static double MAX_LENGTH = 99.98; |
| Final double MAX_LENGTH = 99.98; |
| Final static double MAX_LENGTH = 99.98;. |
8.Which of the following statement is not true? |
| A default no-arg constructor is provided automatically if no constructors are explicitly declared in the class |
| At least one constructor must always be defined explicitly |
| Constructors do not have a return type, not even void |
| Constructors must have the same name as the class itself |
| Constructors are invoked using the new operator when an object is created. |
9.What is the printout for the second statement in the main method? public class Foo { static int i = 0; static int j = 0; public static void main(String[] args) { int i = 2; int k = 3; { int j = 3; System.out.println("i + j is " + i + j); } k = i + j; System.out.println("k is " + k); System.out.println("j is " + j); } } |
| k is 0 |
| k is 1 |
| k is 2 |
| k is 3 |
| k is -1. |
10.Assume int[] scores = {1, 20, 30, 40, 50}, what value does java.util.Arrays.binarySearch(scores, 3) return? |
| 0 |
| -1 |
| 1 |
| 2 |
| -2. |
More Java Programming QUESTIONS AND ANSWERS available in next pages
-
Health is the greatest gift, contentment is the greatest wealth -Buddha
- TNTET 2021 - Practice
- SSC CGL 2021 - Practice
- TNPSC Group 2A 2021 - Practice
- IIT JEE
- IIT JEE Q&A
- TNPSC Answer Keys
- TNPSC Group 2 Syllabus
-
TNPSC Q&A

- Online Tests - TNPSC
- Online Tests - GK
- IBPS 2020-2021
- Online Tests - Bank
- Online Tests - RRB NTPC
- Online Tests - UGC NET
- Online Tests - TANCET
- Online Aptitude Test
-
Engineering

-
Programming

-
Basic Science

-
Quiz

- Plus Two Question Papers
- SSLC Question Bank
-
Aptitude Tests

-
Logical Reasoning

-
General Knowledge-Hindi

-
Indian History MCQ

-
Indian Geography MCQ

-
Indian Civics MCQ

-
Indian Economics MCQ

-
CTET Biology MCQ

-
CTET Chemistry MCQ

-
CTET Physics Solved MCQ

-
Arithmetic Tests

- Press Release
- FAQ
- Coaching Centres
- TNPSC Group 1 Syllabus
-
TNPSC Group IV Syllabus

- TRB 2017 in English PDF

- TRB 2017 in Tamil PDF

- TET
- TNTET
