Java Previous Question Papers with Answers. BOARD. DIPLOMA EXAMINATION, (C- 0. DCME VI. SEMESTER EXAMINATIONTime : 3. Hours. List out Java Keywords. Write about one of the SELECTION statements of Java. Write the usage of break and continue statements. List out Thread properties. List out some of the source of errors in. Explain data type conversion and. Ex: c: \programfiles\java\jdk.
All language compilers translate. Java compilers also does. Java compiler produces an intermediate code known as byte code. JVM takes this byte code and exists only inside the computer. The machine code is generated by the java interpreter, which is acting. Explain for loop with an example. Ans: in looping statements or. Now the control variable is incremented using. Explain data type conversion and casting feature of java with an. It is possible to assign a value of. Java does the. conversion of the assigned value automatically this is known as automatic type. As the ForkJoin Framework is standard in Java 8 and Java 7, you can view the javadoc documentation for all the classes in the standard places, though. About the Author As the founder of Mountain Goat Software, Mike Cohn specializes in helping companies adopt and improve their use of agile processes and techniques to. ![]() It is possible only if the destination type has enough space to. The process of assigning smaller. To store a value of one type into a. To store a value of one type into a. Syntax: datatype. ![]() Casting is necessary when a method returns. Four integer type(byte, short, int, long). Boolean. Casting into smaller type may. Boolean. Casting a floating point value to an integer value, gives. A commandline. argument is the information that directly follows the program name on the. String array passed to main() Public static void main(String args. It may or may not consists abstract. However, if it does not, the subclass. The birth is thread object’s creation and death is thread object’s. ![]() ![]() ![]() During the lifetime of a thread, there are many states it can enter. They include: 1. Born. Runnable state 3. Running state 4. Blocked state 5. Dead state. a thread is always in. It can move from one state to another state via a. It is also known as Visibility modifiers. Java provides 4 types of access. Private, protected, public, default. This is possible by simply declaring the variable or methods as. The variable on method declared as. The protected modifiers makes the fields. Non sub classes in other packages can not access. Private fields are the highest degree of protection they are accessible. A catch block defined by the keyword catch catches the exception. If any one statement generates an. The remaining statements in the block are skipped and execution. The input stream classes define methods for performing input. They are two kinds: 2. Only. difference in that those are used to write characters./* For stream classes hierarchy. For each of stream classes 2 marks: -. DIPLOMA EXAMINATION, (C- 0. DCME VI. SEMESTER EXAMINATIONTime : 3. Hours. List the different awt components in Java. Instructions: (1) Answer any five. How. does this pointer can be used in java program? Explain about how to create. Explain about the order of. Write a java program to. Explain about the creation. Explain about the usage of. This section shows you what literals. Consider the following code: types. Literals(values)1. Floating Point Literals. For example, a variable should be declared to use. To declare a variable in. Java, all that is needed is the data type followed by the variable name: int a; Declaring variables for other. Time; double Price; Initializing Variables. Before a variable can be used it must be given an initial value. If we try to use a variable without. It. is a keyword, which doesn’t contain a body and contains only a method. By default it contains abstract method. By using. interface we can achieve multiple inheritance in java. An interface is. written when all the features are implemented differently in different. It is the duty. of third party people to design implementation to interface methods in the. Ans: The CLASSPATH is an environment. CLASSPATH is. generally set to a directory (or) JAR files. The CLASSPATH option is preferred. Unwanted event that disturbs normal flow. Exception(1) separating error handling code. How does this. pointer can be used in java? Explain the concept of importing packages in java. Ehandler. javaimport Handling.*; import java. Myframe. 2 extends Frame. Explain about how to create a thread with example. We can create the Threads in two ways. Steps for creating Threads in java. Explain about the order of. Write a java program to illustrate the use of. String args. Explain about the creation. Explain about the usage of text field and text area in. A scrollable. text display object with one. Text. Field. Text is created by using a Text. Field. class. The Text field class implements a. Control. Text. Field. By using keys, cut and paste keys. Text field is a sub class of text. When the user indicates that text entry is complete (usually by. Enter), the text field fires an action event. If you need to obtain. To set. the text, call set text ( ). List the various types of inheritance. Write. various types of constructors. Write any siz. common(defined)java exceptions. List. the various types of inheritance. Ans: acquiring the resource from super class to. The different types of inheritance are. Multi- Level inheritance. Hierarchial inheritance. Abstract class. cannot be instantiated, you cannot create an object of an Abstract class. Another class can inherit an. If a class includes abstract methods, the class itself must be. When an abstract class is subclassed, the subclass usually. Unwanted event that disturbs normal flow of the program is. Exception(1). Separating error handling code from regular code(2). Grouping error types and error differentiation(3). Allows the fixing the errors(4). It prevents the abnormal termination. Applet. is a small java program for internet applications(web pages)A Java applet is an Applet. Java byte code. Java applets can run in a Web. Java Virtual Machine (JVM), or in Sun's Applet. Viewer, a. stand- alone tool for testing applets. Explain the features of java. Write. various types of constructors. Write any siz common(defined)java exceptions. An Exception is a condition that is. To. avoid the corrupted data we should create an exception object and throw it. Array. Index. Out. Of. Bounds. Exception. Array. Store. Exception. Explain the following: (a) try and. BOARD. DIPLOMA EXAMINATION, (C- 0. DCME. VI SEMESTER EXAMINATIONTime. Hours. Define method overloading. Write a program. using the concept of method overloading. Write the programs. Explain the following: (a) Try and catch. Throw (c) Finally. If a field is declared private, it cannot be accessed by anyone. For this reason. encapsulation is also referred to as data hiding. The main benefit of encapsulation is the. With this feature Encapsulation gives maintainability. The most common use of polymorphism in OOP. Lifetime of a variable defines the time for which the variable exist in. A block is begun with an opening curly brace and ended by a closing. A block defines a scope. Thus, each time you start a new block. A scope determines what objects are visible to. It also determines the lifetime of those objects. However, if. that method has parameters, they too are included within the method’s scope.- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 4. Your class can implement more than one interface, so the implements keyword is followed. By. convention, the implements clause follows the extends clause, if there is. Java applets can. Web browser using a Java Virtual Machine (JVM), or in Sun's. Applet. Viewer, a stand- alone tool for testing applets.- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 1. A short is 2 times smaller than an int. Default value is 0. Example : short s= 1. Int data type is a 3. Minimum value is - 2,1. Maximum value is 2,1. Int is generally used as the default data type for integral values unless there is a concern about memory. The default value is 0. Example : int a = 1. Long data type is a 6. Minimum value is - 9,2. Maximum value is 9,2. The statements break and continue in. Java alter the normal control flow of. The break and continue statements do not make sense. Without labels (see below), break and continue refer to the most. With labels the break. The continue statement immediately jumps to the. A continue statement does not. Java does not have a general goto. But the statements break and continue take the place of most of uses. Java does allow any statement to be labeled as in (b) Explain the separators used in Java Separators help define the structure of a. The separators used in Hello. World are parentheses, ( ), braces. The table lists the six Java separators. Encloses arguments in method. Selects a field or method from an. Example: public class A . Write a program using. In Java it is. possible to define two or more methods within the same class that share the. When this is. the case, the methods are said to be overloaded, and the process is. Method overloading is one of the ways. Java implements polymorphism. Overload. Demo . Write the programs for creating. A package is the Java. Addition. java. Public int add(int. Note : -d: \> javac –d. Import caliculator. Addition; Public class static void main(String args. Thread gets the ready- to- run state. The thread scheduler provides the CPU. In Java runtime system, preemptive scheduling algorithm is. If at the execution time a thread with a higher priority and all other. On the other hand, if two threads of the same priority. CPU then the round- robin. Here are the. lifecycle methods of an Applet: init(): This method is called to initialized an appletstart(): This method is called after the initialization of the applet. This method can be called. Applet. destroy(): This method is called. The init() method is called only one time in the life cycle on an. The init() method is basically called to read the PARAM tag in the html. The init () method retrieve the passed parameter through the PARAM tag of. Parameter() method All the initialization such as.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
August 2017
Categories |