How To Exam?

a knowledge trading engine...


Amity University 2008 B.E Computer Science JAVA (Data types,variables and Arrays) - Question Paper

Tuesday, 15 January 2013 08:30Web
Ans : Yes
10) Can a byte object be cast to a double value ?
Ans : No. An object cannot be cast to a primitive value.
11) elaborate order of precedence and associativity?
Ans : Order of precedence the order in which operators are evaluated in expressions.
Associativity determines whether an expression is evaluated left-right or right-left.
12) Which Java operator is right associativity?
Ans : = operator.
13) What is the difference ranging from prefix and postfix of -- and ++ operators?
Ans : The prefix form returns the increment or decrement operation and returns the value of the increment or decrement operation.
The postfix form returns the current value of all of the expression and then
performs the increment or decrement operation on that value.
14) What is the outcome of expression 5.45 + "3,2"?
a. The double value 8.6
b. The string ""8.6"
c. The long value 8.
d. The String "5.453.2"
Ans : d
15) elaborate the values of x and y ?
x = 5; y = ++x;
Ans : x = 6; y = six
16) elaborate the values of x and z?
x = 5; z = x++;
Ans : x = 6; z = five


Introduction to Java Programming
1) The Java interpreter is used for the execution of the source code.
a) actual
b) False
Ans: a.
2) On successful compilation a file with the class extension is created.
a) actual
b) False
Ans: a.
3) The Java source code can be created in a Notepad editor.
a) actual
b) False
Ans: a.
4) The Java Program is enclosed in a class definition.
a) actual
b) False
Ans: a.
5) What declarations are needed for every Java application?
Ans: A class and the main( ) method declarations.
6) elaborate the 2 parts in executing a Java program and their purposes?
Ans: 2 parts in executing a Java program are:
Java Compiler and Java Interpreter.
The Java Compiler is used for compilation and the Java Interpreter is used for execution of the application.
7) elaborate the 3 OOPs principles and describe them?
Ans : Encapsulation, Inheritance and Polymorphism are the 3 OOPs
Principles.
Encapsulation:
Is the Mechanism that binds together code and the data it manipulates, and keeps both safe from outside interference and misuse.
Inheritance:
Is the process by which 1 object acquires the properties of a different object.
Polymorphism:
Is a feature that allows 1 interface to be used for a general class of actions.
8) What is a compilation unit?
Ans : Java source code file.
9) What output is displayed as the outcome of executing the subsequent statement?
System.out.println("// Looks like a comment.");
a. // Looks like a comment
b. The statement outcomes in a compilation fault
c. Looks like a comment
d. No output is displayed
Ans : a.
10) In order for a source code file, containing the public class Test, to successfully compile, which of the subsequent must be true?
a. It must have a package statement
b. It must be named Test.java
c. It must import java.lang
d. It must declare a public class named Test
Ans : b
11) elaborate identifiers and what is naming convention?
Ans : Identifiers are used for class names, method names and variable names. An identifier may be any descriptive sequence of upper case & lower case letters,numbers or underscore or dollar sign and must not start with numbers.
12) What is the return kind of program’s main( ) method?
Ans : void
13) What is the argument kind of program’s main( ) method?
Ans : string array.
14) Which characters are as 1st characters of an identifier?
Ans : A – Z, a – z, _ ,$
15) elaborate various comments?
Ans : 1) // -- single line comment
2) /* --
*/ multiple line comment
3) /** --
*/ documentation
16) What is the difference ranging from constructor method and method?
Ans : Constructor will be automatically invoked when an object is created. Whereas method has to be call explicitly.
17) What is the use of bin and lib in JDK?
Ans : Bin contains all tools such as javac, applet viewer, awt tool etc., whereas Lib
contains all packages and variables.








( 0 Votes )

Add comment


Security code
Refresh

Earning:   Approval pending.
You are here: PAPER Amity University 2008 B.E Computer Science JAVA (Data types,variables and Arrays) - Question Paper