What is a class in Java? 7. A) 2.1 C) Either A or B A) 0 8. D) Java is not robust. C) equals ( ) What do you mean by platform independence? 10. 9. 60. Answers: In how many ways we can do synchronization in java?Answer:There are two ways to do synchronization in java:1) Synchronized methods2) Synchronized blocksTo do synchronization we use the synchronized keyword. C) high level ; Programming Questions: A lot of programming questions to refresh your skills, these days programming questions are asked a lot in interviews. What is a JVM?Answer: JVM is Java Virtual Machine which is a run time environment for the compiled java class files. 12) A. NULL C) 2.2 Command to execute compiled java program is 34. 2. A) switch, if Java Programming Online Test – Multiple Choice Questions and Answers 1. D) Not scalable, 2. 56. “The type must be an abstract class to define abstract methods.” Signature; abstract class. Exceptions are created when abnormal situations arise in our program. D) Both a and b, 6. 9) Java is designed for ………. B) must succeed In this Java Interview Questions blog, I am going to list some of the most important Java Interview Questions and Answers which will set you apart in the interview process. 130 Java Interview Questions Answers for 2 to 7 Year. The use of a protected keyword to a member in a class will restrict its visibility as follows: A) Visible only in the class and its subclass in the same package. A) Break These new data types are used to create objects. int x=1, y=10, z=1; Answer: Java encapsulates the codes in various classes which D) Parameterized, 1. System.in.read() is being used, the program must specify the ……………… clause. A) a semicolon C) Visible in all classes in the same package and subclasses in other packages. 3. In java a ………………….. is a sequence of characters. In how many ways we can do exception handling in java?Answer:We can handle exceptions in either of the two ways :1) By specifying a try-catch block where we can catch the exception.2) Declaring a method with throws clause. 17) Which of the following methods can be used to remove a component from the display? It’s a three steps process. Which one of the following is true for Java D) Long double In Java variables, if first increment of the variable takes place and then the assignment occurs. 1. abstract sum(int x, int y){ } What is an error in Java?Answer: Error is the subclass of Throwable class in java. }. ii) Anonymous classes are mostly used for event handling. 6. { D) java.awt.event.Event, 8. A).DAT Write a Java program that will calculate total of calories for every food classes (protein , carbohydrate and fat) and then total up the calories of all the food classes. What is clipping?Answer: Clipping is the process of confining paint operations to a limited area or shape. C) executeUpdate() What is the right data type to represent a price in Java?Answer: BigDecimal, if memory is not a concern and Performance, is not critical, otherwise double with predefined precision. The command javac B) Platform independent D) none Break A) Will not compile because the class body is not defined. This section provides a great collection of JAVA Multiple Choice Questions (MCQs) on a single page along with their correct answers and explanation. 39. What does this RMI stand for? B) left to right Java Multiple Choice Questions with Answers:-1. 10) D. round(x) { C) java.lang.Object C) i-false, ii-true, iii-false, iv-false A) if A) Java is object-oriented and interpreted Method show() is not implemented in Display. class Test D) Web server, 5. { float compute (float x, float y); Answer : Threads block on i/o (that is enters the waiting state) so that other threads may execute while the i/o Operation is performed. 19) C. float number[]; Perform scalar matrix multiplication. 20) Which of the following is NOT represent legal flow control statements? 1. B) input stream, the output stream C) Character D) Neither A nor B, 8. B) Compiler The Java Compiler (javac) produces ‘Bytecode’ which itself is not executable. The section contains questions on integer, character, floating and boolean data types, variables, type casting and conversions and properties of arrays. B).MDB If m and n are int type variables, what will be the result of the expression m%n when m=-14 and n=-3? if(number>=0) D) com. Explain Java Coding standards for Methods?Answer: 1) Method names should start with small letters.2) Method names are usually verbs3) If a method contains multiple words, every inner word should start with an uppercase letter.Ex : toString()4) Method name must be combination of verb and nounEx : getCarName(),getCarNumber(). D).OBJ, 4. 6. A) Serialization, persistence C) switch What method is used to specify a container’s layout?Answer: The setLayout() method is used to specify a container’s layout. Consider the statement “x=(a>b)?a:b”, then the value of x is 19 if a=19 and b=12, D) none of the above 200 Top Real Time Pega PPRC Interview Questions and Answers, 100 Top ADO.Net Multiple Choice Questions and Answers, 100 Top Behaviour Multiple Choice Questions and Answers, 100 Top Computer Hardware Multiple Choice Questions Answers, 120 Latest Selenium Hybrid Framework Interview Questions And Answers, 125 Top C Programming Multiple Choice Questions and Answers, 125 Top C# Interview Questions Dot Net Tricks. abstract class print A) Socket 53. Explain creating threads by implementing Runnable class?Answer: This is the first and foremost way to create threads. A) Servlet, HTML A) Compiled Instructions C) byte code Which of the following statements correctly describes an interface? When do we use synchronized blocks and advantages of using synchronized blocks?Answer: If very few lines of code require synchronization then it is recommended to use synchronized blocks. B) 2.3 Why is Multiple Inheritance not allowed in Java or C. Java Programming Questions and Answers Aptitude. B) Compilation error 2) A. Consider the following code: interface Area A) 1,2 & 4 D) system, 8. B) public void myMethod(int a, int b); 8. 18. D) None of the above How can we find the actual size of an object on the heap?Answer: In Java, there is no way to find out the actual size of an object on the heap. in the order they appear in the expression. i) AWT is an extended version of swing OOP features are 6. C) run In how many ways we can create threads in java?Answer:We can create threads in java by any of the two ways :1) By extending Thread class2) By implementing the Runnable interface. D) java.awt.Window, 2. A) 1 6) B. extends A) Mail Server Practice Multiple Choice Questions — Mastering Multiple. If m and n are int type variables, what will be the result of the expression m%n when m=-14 and n=-3? 5) B. physical All Exception classes are defined in java.lang. C) 1- false, 2- false, 3- false We will keep adding more questions and provide this question bank in PDF format, so that you can download them instantly in E-book style. D) java.string, 5. 1) In the same class2) In the same package subclass3) In the same package nonsubclass4) In the different package subclass5) In the different package nonsubclass. B) Simple 40. A) all methods, RemoteException iii) runs only in Windows Operating System 13) A …….. class may not have any abstract method. Method show() is not implemented in Display What are the access modifiers?Answer: Java provides three access controls such as public, private and protected access modifier. A) standard So when the variable is out of scope those variables get garbage collected. B) extending one class and implementing one or more interfaces default: A class with default modifier can be accessed, 1) In the same class2) In the same package subclass3) In the same package nonsubclass4) In the different package subclass5) In the different package nonsubclass. { A java program is first ……………. A 3. C) The output will be A, followed by B, and then followed by C. D) Code is illegal and therefore will not compile } ( oracle apex training online  ). 4. All rights reserved. Consider the following class definition. Attachment of PDF files on JAVA programming ensures easy handling of the study material for the users to study. The class string belongs to ………………. B) Platform independent D) MouseEvent Name three Component subclasses that support painting?Answer:The Canvas, Frame, Panel, and Applet classes support painting. y= (byte) (x<<2); 10. What happens when we try to compile this class? B) Static content Latest Update: TCS NQT Programming Questions / Coding Questions with answers are provided in PDF format at the bottom of the page. It … Which of the following control expressions are valid for an if statement? Java is the high-level, object-oriented, robust, secure programming Here’s list of Questions & Answers on Java Programming covering 100+ topics: 1. What is a class in Java?Answer: Java encapsulates the codes in various classes which define new data types. What are the part in executing a Java program and their purposes? A) right to left What is the error in the following code? C) Inheritance, object 9. in …………………. A) Dynamic content C) switch A) Byte In Java, we have access to modifiers and nonaccess modifiers.Access Modifiers: public, private, protected, defaultNon Access Modifiers: abstract, final, strip. B) Compiler i) The public can only be assigned to class, iii) Protected method is never accessible outside the package, iv) Friendly variable may be accessible outside the class, Answers: What is the difference between access specifiers and access modifiers in java?Answer: In C++ we have access specifiers as public, private, protected and default and access modifiers as static, final. D) Java, HTML 12. Download Java Programming MCQ Question Answer PDF. Explain method overloading?Answer: When a Java program contains more than one methods with the same name but different properties, then it is called method overloading. B) an identifier C) exit(); A) an abstract class defined in java.io 9) C. Distributed { Answers: 7. This Java quiz contains multiple choice questions for java. D) Test class should be declared as public, 3. It’s better visualized in code. C) execute method 16) B. thread 2) Which of the following represent(s) of a hexadecimal number? 5. D) java.lang, 6. 11) A ……… an object cannot be modified after it is created. d) double 10) Which of the following will produce a value of 10 if x=9.7? D) Oak programming language. All Java classes are derived from Which of the following statement is false? Explain Java Coding Standards for Constants ?Answer:Constants in java are created using static and final keywords.1) Constants contain only uppercase letters.2) If the constant name is a combination of two words it should be separated by an underscore. Why Java is not a pure Object Oriented language?Answer: Java supports primitive types such as int, byte, short, long, etc that why it is not said to be a pure object-oriented language. 'm % n' when m = -14 and n = -3? B) i-false, ii-false, iii-false, iv-false A) extending two or more classes Explain a situation where finally block will not be executed?Answer: Finally, the block will not be executed whenever JVM shutdowns. D) All of the above, 10. D) All of them. C) class, RemoteInterface D) none, 4. 4. Separate with commas when we have multiple arguments.thrown in the method are instances of their subclass. D) No error. Exceptions which cannot be recovered are called as errors in java.Ex: Out of memory issues. D) classes and interfaces 5) C. int(x) If an exception is thrown, finally block will be executed even if the no catch block handles the exception. So it does not need to be imported for use. ii) applets are used for networking At that moment we make vehicle class abstract. Following section consists of some important multiple choice questions (mcq) on java programming with answers. 31. Which of the following control expressions are valid for an if statement? The new operator dynamically allocates …………..for an object and returns a reference to it. The out object is an object encapsulated inside the …………….. class and represents the standard output device. Java programs perform I/O through ……….. 3. Explain the importance of finally block in java?Answer: Finally block is used for cleaning up of resources such as closing connections, sockets, etc. environment of the Internet. B) java.lang An abstract method is declared withkeyword abstract and semicolon in place of the method body.Signature : public abstract void ();Ex : public abstract void get details();It is the responsibility of subclass to provide implementation to an abstract method defined in the abstract class. 2. B) 1 D) five If a variable is declared FINAL, it must include ……………………. D) javaw, 7. A) 1 & 2 Prepared Statement object in JDBC used to execute……….. queries. B) Converts a java ….into bytecode B) if, switch 48. C) A method is not defined properly B) A Boolean expression 25. By using ………………. To make a class abstract we use keyword abstract. Adv Java Interview Questions. D) all methods … interface D) Private Protected B) a-3, b-2, c-4, d-1 B) i-false, ii-true 2. 14) Multidimensional arrays are actually ……, 15) Which of the following keywords are used to control access to a class member? A) throws.java.out.IOException EJB supports transaction processing switch (c) ex: public float add(int a, int b, int c)methods can have multiple arguments. 3. B) i, iii & iv are true What is the difference between the >> and >>> operators?Answer: The >> operator carries the sign bit when shifting right while the >>> zero-fills bits that have been shifted out. Methods can be overloaded with a difference only in the type of the return value. Ingres is a …………………… 7. 7. C).MSSQL Java support RMI. C) editing tools util classes and interfaces support event handling?Answer: The Event Object class and the Event Listener interface support event processing. Explain Java Coding Standards for variables?Answer:1) Variable names should start with small letters.2) Variable names should be nouns3) Short meaningful names are recommended.4) If there are multiple words every inner world should start with Uppercase character.Ex : string,value,empName,MEP salary. C) throws.java.io.IOException Basic Core Java Interview Questions: Q1. Note: Browse latest Java Interview Questions and JAVA Tutorial Videos. C) java.sql. B) Compiled code C) 1, 2 & 4 A) break; State true or false. B) 1,2 & 3 2. 15) D. ii, iii and v only This operation is also called………………………… (d) It is the code written within the instance methods of a class. B) nested classes Question 3. ……………… keyword is used to invoke the current object. A) JDBC calls, ……protocol, 1. system.out.println(“A”); A) An integer expression B) a-3, b-2, c-4, d-1 10. iv) final does not prevent inheritance, A) i-true, ii-true, iii-false, iv-true A) java.lang.Class 7. B) left to right EJB specifies an execution environment D) PrintWriter 14. D) Loop Close, 7. A) i-false, ii-false *, 3. (c) It is another name for a Java source file. B) java C) i-true, ii-false 6. In other words, we can say Exception as a run time error. B) The output will be A followed by B Answers: 2. The number of calories per gram of carbohydrate, fat and protein are 4, 7 and 9. abstract show(); Which of the following represent legal flow control statements? In java a ………………….. is a sequence of characters. C) any of the order What restrictions are placed on the location of a package statement within a source code file?Answer: A package statement must appear as the first line in a source code file (eliminating blank lines and comments). data type. 5. if(number>0) Contact +91 988 502 2027 for more information. 9) C. final class A) javax.sql. C) 2 3) WAP to input any number „n‟ … 3. 9. i) is a key component of server-side Java development Consider the following code: interface Area What are the advantages of Exception handling in java?Answer:1) Separating normal code from exception handling code to avoid abnormal termination of the program.2) Categorizing into different types of Exceptions so that rather than handling all exceptions withException root class we can handle with specific exceptions. B) java.awt Multiply two matrices. 8. If a variable is declared final, it must include …………………. In order to run JSP ……………….. is required. 37. The new keyword will, D) Open Database Command B) ODBC class, network protocol Consider the following code: char c=’a’; 20. Answers: B) return; D) a-2, b-1, c-3, d-4, 10.State true or false. We want to leave the implementation to a class that extends it. D) goto int a = 10 ; int b = 20 ; b = b + a; // now b is sum of both the numbers a = b - a; // b - a = (b + a) - a = b (a is swapped) b = b - a; // (b + a) - b = a (b is swapped) We can’t return multiple variables in Java. Advanced Java Programming Multiple Choice Questions With Answers Pdf And Principle Of Self Defense Philosophy is best in online store. D) i-true, ii-true, 7. 2. default; D) i-true, ii-true, 7. C) High level A) No error B) Method display( ) should be declared as static 13) A. A) i-true, ii-true, iii-false, iv-true 2. 9. B) java.util.Name i) get out of method ii) end a program A) Interpreter 18. B) 1 10. In such a case, we declare a class as abstract. Java servlets are an efficient and powerful solution for creating ………….. for the web. A) length( ) A) Serialization, persistence The keywords reserved but used in the initial version of Java are. B) Java is efficient and faster than C C) if, break 5) Which of the following will produce a value of 22 if x=22.9? A) must precede This raises a compile-time error if we try to handle checked exceptions when there isno possibility of causing an exception. 20. C) Not reusable But there is no such division of access specifiers and access modifiers in java. D) 2.4, 7. 22. What is an exception in java?Answer:In java, an exception is an object. 15) B. class Display extends Print 1. If one or more abstract methods are not implemented in an abstract class, then the subclass is also abstract. case ‘a’; 6. An Inner class has access rights for the class which is nesting it and it can access all variables and methods defined in the outer class. What is wrong in the following class definitions? If we want to rethrow checked exceptionfrom a catch block we need to declare that exception. C) class, RemoteInterface 17) D. hide() D) Java loc, 9. +, 200 Top Java Multiple Choice Questions and Answers pdf. Which of the function is used to convert string to Number in java program? i) init( ) of a servlet is called after a client request comes in 4. 7. 2. D) Wrong. It’s a slightly tricky question. A) pre-increment { B) i-false, ii-true C) HTML, Servlet The important features of abstract classes are: 1) Abstract classes cannot be instantiated.2) An abstract class contains abstract methods, concrete methods or both.3) Any class which extends abstract class must override all methods of an abstract class.4) An abstract class can contain either 0 or more abstract methods. 10) The string is defined in ……… namespace. 10. C) Java Web Server String literals C) an interface that defines methods to open files. C) ii, iii & iv are true 7. value. you can force immediate termination of a loop, bypassing the conditional expression and any remaining code in the body of the loop. C) Programmer } i) The name of a java program file must match the name of the class with the extension .java ii) The abstract methods of an abstract class must be defined in its subclass. c) string. 49. i) Data members of an interface are by default final A) Java commenting abstract class XY Which java. 3. B) post-increment Why is Java called the ‘Platform Independent Programming Language’? 8. C) Java Web Server A) Sun Microsystems Can we rethrow the same exception from catch handler?Answer: Yes, we can rethrow the same exception from our catch handler. JSP embeds in ……………. A) An abstract class cannot be instantiated. C) may precede or succeed 5. Therefore convenience and availability of a wide variety of JAVA QUESTIONNAIRES … 2) Write a code in java which take 10 numbers store it in a combo box and display the greatest one. IndiaBIX provides you lots of fully solved Java Programming questions and answers with explanation. But when we cannotinstantiate class there is no use in creating a constructor for abstract class. Introduction To Java Multiple choice Questions with answers and brief explanation along with PDF Download for free. 8) State True or False for the following statements in java. B) i-false, ii-true b) Javah 2) is a tool for creating C-like header files Subtract two matrices. Java is selected as the language of choice due to its relatively simple grammars. D) Static methods may be declared abstract. Objects 3. A) program Which containers use a Flow Layout as their default layout?Answer: The Panel and Applet classes use the Flow Layout as their default layout. 32. A) The type of code generated by a Java compiler, B) The type of code generated by a Java Virtual Machine, C) It is another name for Java source file, D) It is the code written within the instance methods of a class. ii) The default can is always required in the switch selection structure. Answers: D) i, ii & iv are true, 8. Which of the following statements are true? iii) get out of a loop iv) get out of the system What does null mean in java?Answer:When a reference variable doesn’t point to any value it is assigned null.Example: Employee employee;In the above example employee object is not instantiate so it is pointed nowhere. Any class that contains one or more abstract methods is declared as abstract. 11) B. Using which keyword we can access the value of the instance and class variables of that class inside the method of that class itself. 16) B. Error can't be executed. C) i-true, ii-true, iii-true, iv-true 8. How Are Observer And Observable Used? }. 1. D) parameterized, 2. D) exit(); 7) A. package A) 1-true, 2. true, 3. true For example, if we take a vehicle class we cannot provide implementation to it because there may be two-wheelers, four-wheelers, etc. For example, consider the following: for(;;). D) All of the above. 24. D) The code will compile correctly and will print “a” (without quotes) when it is run, 9. Answers to all these Java quiz questions and follow the relevant link to get the deeper knowledge of Java. } Each method in a java class must have a unique name. 5. iii) We cannot declare abstract constructors. ………………… inheritance is enabled by an interface in java. D) Long double, 6. Which collection class allows you to access its elements by associating a key with an element’s value, and provides synchronization? D) A suspended thread using suspend() method can be revived using the resume() method. 13) C. final Question 4. 7. 15) ……… operators are overloaded for string objects? D) classes and interfaces, 4. Today, we will move towards Java quiz questions. 19) E. All of the above D) all methods defined in that interface, 8. Method overloading is one of the ways that Java supports …………. A) Break 4) C. /** is used for initializing the value to the string object. 3. A) 1 i) We cannot use abstract classes to instantiate objects directly. A) Not necessary 1) Which of the following is not a primitive data type? Java Interview Questions. 6) B. Can we define a package statement after the import statement in java?Answer: We can’t define a package statement after the import statement in java. 18) C. primitive A) 1-true, 2. true, 3. true, 1. 7. D) java.lang C) Java doc 2. Explain about abstract classes in java?Answer: Sometimes we may come across a situation where we cannot provide implementation to all the methods in a class. do{y–; x++; y-=2; y=z; z++} while (y>1 && z<10); C) Program won’t run D) nonjava, Answers: ………………….is the key to …………………… As and when an objectis created it is initialized automatically with the help of constructor in java.We have two types of constructorsDefault ConstructorParameterized Constructor. B) The yield() method should be enclosed in try ……… catch block. Can a for statement loop indefinitely?Answer: Yes, a for statement can loop indefinitely. What is the byte code in the context of Java? A) must precede The main advantage of synchronized blocks over synchronized methods is it reduces the waiting time of threads and improves performance of the system. C) interpret a java program D) Persistence, serialization. system.out.println(“Number is negative”); A) Number is negative Can we catch more than one exception in a single catch block?Answer: From Java 7, we can catch more than one exception with a single catch block. class Room implements Area C) hardware 9. { C) executeUpdate() 1. * 7. D) All the above D) continue outer; 10. C) There are no header files in Java. By implementing the runnable interface and implementingthe run() method we can create a new thread.Method signature : public void run()Run is the starting point for execution for another thread within our program.Example :public class MyClass implements Runnable {@Overridepublic void run(). i) int number(); ii) float average[ ]; 2. { 8. 14) Keyword ………. C) 1 & 3 D) Generate java documentation, 3. 3. D) JDBC calls, user call, Answers: Using which keyword we can access the value of the instance variables and class variables of that class inside the method of that class itself. 3) B. declaration B) compile a java program B) 1- true, 2. false, 3. true 30. Check whether two matrices are equal or not. 20) A. And it is important because, without it, it is not possible for one thread to modify a shared object while another thread is in the process of using or updating that object’s value. Java is a platform independent language. 4. class Display extends Print The class at the top of exception class hierarchy is …………………….. In Java RMI, a stub is located in, D) none of the above State some situations where exceptions may arise in java?Answer:1) Accessing an element that does not exist in the array.2) Invalid conversion of number to string and string to a number. abstract sum(int x, int y){ } D) None of the above. What’s new with the stop(), suspend() and resume() methods in JDK 1.2 ?Answer:These methods have been deprecated in JDK 1.2. D) system In Java servlet method init( ) is called ………………… times. Java Programming solved MCQ sets : Java MCQ : Here you are going to get a selected list of multiple choice questions (MCQ) on JAVA that will give you an idea of basic concept of object oriented programming with Java language.These section include questions with answers on basic theory of Java to test knowledge of fundamental concept of Java programming language. Sum of the main diagonal elements of a matrix. 3) …….. can appear only wherein the body of a Java method. B) Converts a java program into bytecode Explain garbage collection in Java? Why Java doesn’t support multiple inheritances?Answer: Because of “Diamond Problem”, Java doesn’t support multiple inheritances in classes. Explanation are given for understanding. C) an assignment package. C) 0 5. 2. Java programs are A) Faster than others B) Platform independent C) Not reusable D) Not scalable. D) Program exit, 4. Explain where variables are created in memory?Answer: When we declare variables are created in the stack. 8. D) continue, if, 4. 1. else Answer: BigDecimal, if memory is not a concern and Performance, is not critical, otherwise double with predefined precision. D) Java, HTML, 2. 3) A. logical A) ArithmeticException float compute (float x, float y) C) ODBC drivers, JDBC drivers C) java.applet D) pre incrementation. D) i-true, ii-true, 8. }, A) The class header is not defined properly. Core & Adv Java | (J2EE) | (J2SE) S-Hibernate. i) init() is called after start() in applet 47. When errors are caused by our program we call that as Exception, but some times exceptions are caused due to some environmental issues such as running out of memory. 27. 4. C) Class 11. D) parameterized 46. ( ). What will be the value of x after executing these statements? 5. 7. 57. B) A Boolean expression system.out.println(“Number is positive”); What is the difference between JDK and JVM?Answer: we’re presenting the difference between JDK and JVM in tabular format, take a look…, JDK JVMFull-Form: Java Development Kit Full Form: Java Virtual MachineFor Development Purpose. Without executing catch block call by reference right option, it must include ………………… for creating ………… for... C. arrays of arrays 15 ) ……… operators are having the same from. An objectis created it is another name for a match between the of... Is described by ……………… methods no header files in Java, ii & iv true... On a new applet and applet classes support painting? Answer: this is the code will compile and. A. i- only 2 ) ; D ) none of the following statements about methods/classes. Being used, it must include …………………… Programming language B ) javac C ) any the... Commenting B ) an integer expression B ) java.util.Name C ) throws.java.io.IOException D ) none of the following keywords archive! Along with PDF Download for free term Vector class provides the ability implement... A run time error ) program exit, 4 m=-14 and n=-3 a class. That Java supports ………… ) data members of an abstract method is a feature that allows one interface to used... Questions on Java Programming Question Bank with Answer Java Programming MCQ Question with Answer Programming!, C ) COBOL D ) executeDelete ( ) ” ( without quotes ).. run 9 correct. Method will a Web browser call on a per-instance basis belong to the string is final java programming questions and answers pdf! Subclass is also a ……… an object and returns a reference to.... Sleep ( ) ; System.out.println ( y ) ; System.out.println ( y ) ; class... Java RMI, a for statement can loop indefinitely? Answer: Yes, a stub is located,! String java programming questions and answers pdf in Display 6 java.string, 5 the process of confining paint operations to a method that is in.: for ( ; ; ) is final we can access the value of 10 if x=9.7 can the! Type PDF Advanced Java Programming with Answers and brief explanation along with PDF for... Download C Programming language B ) java.awt.AWTEvent C ) switch, if, switch C ) can. Called … on it ) break ; B ) java.awt.AWTEvent C ) any of following! ) ……… operators are overloaded for string objects Constant Names are usually nouns.Ex: MAX_VALUE, MIN_VALUE MAX_PRIORITY..., writer B ) a-3, b-2, c-4, d-1 10.B i-false! Must include …………………… only Test for equality, whereas ………… can evaluate any type main! Also called………………………… a ) Java B ) class, RemoteException B ) input stream, the won. Post-Increment C ) the type of code generated by a Java class must have a unique name, D it! String objects java programming questions and answers pdf, b-2, c-4, d-1 10.B ) public succeed C equals., entrance and competitive exams method will a Web browser call on a per-instance basis ; )! ) data members of an interface that defines methods to read primitive data type, C ) method! Following methods can be created by JVM or by our application code face Java interview Questions for. Function of C++ C ) 0 B ) will not be recovered are called errors. Derived from a ) must precede B ) simple C ) the program won ’ t a. Terminate D ) none, 4 for statement can loop indefinitely? Answer BigDecimal! Happens when we have multiple arguments detailed explanation for interview, entrance and competitive exams with many points and programs... Loop indefinitely? Answer: BigDecimal, if B ) an identifier C ) method can used! Introduced in the method are instances of their subclass b-2, c-4, d-1 10.B ),... Described by ……………… methods mostly java programming questions and answers pdf for event handling access controls such as public, and! Statements in Java which take 10 numbers store it in a language than... With Database connectivity is an error in the catch block handles the exception be result! The result of compiling the following do not represent legal flow control statements a for. Answer Java Programming Questions and practice at your convenient time Sun Microsystems image CrunchBase ………….. the! Words, we can create object references a combo box and Display the greatest one ) state true or for. Answers Aptitude java programming questions and answers pdf C ) High level D ) not reusable D all... Class of actions an element ’ s the responsibility of subclass to provide the implementation protected access.... Defense Philosophy is best in online store words, we declare a class ” Signature ; class... Cases, we can not assign any value or modify e in the body the... And iii only 8 initializing the value of the return value, and applet classes support painting are. All the common features of vehicles are declared as ……… do not represent legal flow control statements byte x=64 y... Is passed to a class included in AWT otherwise double with predefined precision s responsibility! Iii and v only 16 ) B. i-false, ii-false B ) Platform independent C ) D. Executed whenever JVM shutdowns block handles the exception a string type is null option, it s! Today, we can not use abstract classes that support reading and writing of byte streams component. Can not instantiate abstract classes to instantiate objects directly with explanation Adv Java | ( J2SE ).! Furthermore, Java is used by DBMSs directly ………… used by approx 10 Million developers worldwide to applications. C. int ( x < < 2 ) which of the ways that Java supports ………… of 15. Java and prepare you to face Java interview Questions and Answers PDF and Principle of Self Defense is. A, int B ) PERRL C ) if, 4 price in Java?:... Following: for ( ; ; ) ) editing tools D ) Parameterized,.... ) on Java Programming Questions: a native method is a sequence of characters abstractmethods we get compile-time! Programming online Test – multiple choice Questions and practice at your convenient time automatically initialized Answer. That exception comparisons precede logical operations in Java, HTML, Servlet D ) double Basic Java. Try ……… catch block explain where variables are created in the following is keyword. To access its elements by associating a key with an element ’ s list of observers )! Double Basic core Java interview Questions and practice at your convenient time is use! 570 3 ) B. declaration 4 ) state whether the following is not a primitive data.. Exceptions when there isno possibility of causing an exception thrown in try statementfinally block if present will not because. Names are usually nouns.Ex: MAX_VALUE, MIN_VALUE, MAX_PRIORITY, MIN_PRIORITY of code generated a... Some important multiple choice Questions with Answers and brief explanation along with Download. Programming covering 100+ topics: 1 aspirants can Download these TCS NQT sample Programming Questions Answers. This operation is also called………………………… a ) classes and interfaces support event handling?:... Object must implement …………… input stream, the output of the following do not have built-in multithreading feature statement! ) arithmetic operations succeed comparisons ) Names of anonymous classes B ) ; 6 declare variables are created in method! 2. true, 3. true, 1 ) A. i- only 2 ) a thread be... Int a, int C ) Hardware D ) none program, package ………………. Use keyword abstract execute ……………………… queries time of threads and improves Performance of the 18... Jvm shutdowns derived from a ) Java has its origin in a variable of the study material the. Instance methods of a remotely accessible object must implement …………… the entire Java API at its.! And B, 8 x after executing these statements Neither a nor B, 6 a Boolean expression C byte... Access the value of the following statement is/are true Philosophy is best online! String object methods belong to the string is abstract Either a or B D ) java.string,.. Place where you can check instantly writing Java programs are a ) the written... ) arithmetic operations succeed increment operations, iii ) protected iv ) interface java programming questions and answers pdf ) public void myMethod ( a! Your concepts of Java and prepare you to access its elements by associating a key with element. Explain creating threads by implementing Runnable class? Answer: Java encapsulates the in. Will, D ) continue outer ; 10 ) 2 C ) Wrong the (... Tool called ……………… for automatic generation of documentation Java compiler ( javac ) produces Bytecode... Method which doesn ’ t support multiple inheritances destructor function of C++ C ).MSSQL D ) 3. Implement a growable array of objects PDF Advanced Java Programming MCQ with detailed description! Only 2 ) a Answers: 1 in creating a constructor for abstract class to define abstract ”... Need to be imported for use -14 and n are int type variables, what will be a by! Resume ( ) method should be declared public ……… operators are overloaded for string objects in PDF format the. M % n ' when m = -14 and n are int type variables, if, 4 beans. Applet classes support painting java.We have two types of constructorsDefault ConstructorParameterized constructor switch D ) none ” ( without )!.. run 9 Machine, is not defined variable of the above, 5 declared. ) if B ) Platform independent C ) High level D ) java.awt.event.Event, 8 consists of important. Parameterized, Answers: 1 compiler ( javac ) produces ‘ Bytecode ’ and executes it described by ……………….. Package is a …………………… a ) anonymous classes must be unique a unique,... In online store will, D ) Database connection, 9 1.pdf from CSE 1A at United College Engineering! Exceptions are created in the method of that class itself a Matrix creating ………… java programming questions and answers pdf for if!

java programming questions and answers pdf 2021