Core Java Interview Questions – Set 12

Can a double value be cast to a byte Yes, a double value can be cast to a byte. Is the ternary operator written x : y ? z or x ? y : z It is written x ? y : z. Can an abstract class be final An abstract class may not be declared as final. What is the difference … Read more

Core Java Interview Questions – Set 11

What is Domain Naming Service(DNS)?- It is very difficult to remember a set of numbers(IP address) to connect to the Internet. The Domain Naming Service(DNS) is used to overcome this problem. It maps one particular IP address to a string of characters. For example, www. mascom. com implies com is the domain name reserved for … Read more

Core Java Interview Questions – Set 10

What methods are used to get and set the text label displayed by a Button object? getLabel() and setLabel(). What is the difference between choice and list? ?– A Choice is displayed in a compact form that requires you to pull it down to see the list of available choices and only one item may be selected … Read more

Core Java Interview Questions – Set 09

How are commas used in the intialization and iteration parts of a for statement Commas are used to separate multiple statements within the initialization and iteration parts of a forstatement. When are the non static variables loaded into the memory They are loaded just before the constructor is called What modifiers can be used with a … Read more

Core Java Interview Questions – Set 08

What values of the bits are shifted in after the shift In case of signed left shift >> the new bits are set to zero. But in case of signed right shift it takes the value of most significant bit before the shift, that is if the most significant bit before shift is 0 it … Read more

Core Java Interview Questions – Set 07

What is the difference between preemptive scheduling and time slicing Under preemptive scheduling, the highest priority task executes until it enters the waiting or dead states or a higher priority task comes into existence. Under time slicing, a task executes for a predefined slice of time and then reenters the pool of ready tasks. The … Read more

Core Java Interview Questions – Set 06

What is the difference between the Reader/Writer class hierarchy and the InputStream/OutputStream class hierarchy The Reader/Writer class hierarchy is character-oriented, and the InputStream/OutputStream class hierarchy is byte-oriented. How is an argument passed in java, by copy or by reference What is a modulo operator This operator gives the value which is related to the remainder of a divisione.g x=7%4 … Read more

Core Java Interview Questions – Set 05

What is the return type of a program’s main() method? A program’s main() method has a void return type. Can you change the reference of the final object No the reference cannot be change, but the data in that object can be changed What is the argument type of a program’s main() method A program’s main() method … Read more

Core Java Interview Questions – Set 04

What is the immediate superclass of Menu MenuItem. What is the purpose of a statement block A statement block is used to organize a sequence of statements as a single statement group. What is a native method? A native method is a method that is implemented in a language other than Java Which containers use … Read more

Core Java Interview Questions – Set 03

Name two subclasses of the Text Component class. TextField and TextArea. Where can static modifiers be used They can be applied to variables, methods and even a block of code, static methods and variables are not associated with any instance of class. What advantage do Java’s layout managers provide over traditional windowing systems Java uses layout managers to … Read more