What are Native Methods? How do you Use them?  | SolveZone
whatssapp

Product Detail

What are Native Methods? How do you Use them? 

University  Amity blog
Service Type Assignment
Course
Semester
Short Name or Subject Code Java Programming
Product of Assignment (Amity blog)
Pattern Section A,B,C Wise
Price
Click to view price

Java Programming

Assignment A

1. What are the most important features of Java? How does Java achieve platform independence?

2. a) What are native methods? How do you use them? 


b)   What are wrapper classes? Why are they used?    

3. Explain the concept of method overriding. Can we over-ride method within the same class? Explain.  

4. What is a static method? Why can’t a static method use ‘this’ and ‘super’? Explain with example.


5. a) State the significance of public, private, protected, default modifiers 

 b) What are different types of inner classes?


6. a) How does exception-handling work in Java? 

    
b) Why Java doesn't support multiple inheritances?    


7. Explain the concept of interface. What is scope and nature of variables and methods defined in an interface?

8. Explain the event delegation models in AWT. What are the components of an event?

Assignment B
Case Detail:

Read the following and create appropriate java applets.
a)  Create a try block that is likely to generate two types of exception and then incorporate necessary catch block to handle them appropriately
b) Create a java applet with a button “Display”. On click of button it should display Rectangle,   Oval and Circle within the Applet.
c)  Create the following form in Java:-
Questions    
1.  Subject should display name of subjects: - C++, VB and Java 


2. Foreign language should display choice of foreign languages French, German and Japanese. 


3. Submit button should submit the result.


Assignment C     

Question No.  1    Marks - 10
Which of these operators is used to allocate memory to array variable in Java?    
Options    
malloc    
alloc
new    
new malloc

Question No.  2    Marks - 10
Which of these is an incorrect array declaration?    
 
Options    
int arr[] = new int[5]    
int [] arr = new int[5]    
int arr[] arr = new int[5]    
int arr[] = int [5] new

Question No.  3    Marks - 10
What will this code print? int arr[] = new int [5]; System.out.print(arr);    
 
Options    
0    
value stored in arr[0].    
0    
Garbage value

Question No.  4    Marks - 10
Which of these is an incorrect Statement?    
 
Options    
It is necessary to use new operator to initialize an array.    
Array can be initialized using comma separated expressions surrounded by curly braces.    
Array can be initialized when they are declared.    
None of these

Question No.  5    Marks - 10
What is the range of data type byte in Java?    
Options    
-128 to 127    
-32768 to 32767    
-2147483648 to 2147483647    
127 to -133

Question No.  6    Marks - 10
An expression involving byte, int, and literal numbers is promoted to which of these?     
Options    
int    
long    
byte    
float

Question No.  7    Marks - 10
Which of these literals can be contained in a data type float variable?    
Options    
1.7e -308    
3.4e -038    
1.7e+308    
3.4e -050

Question No.  8    Marks - 10
Which data type value is returned by all transcendental math functions?     
Options    
int    
float    
double    
long

Question No.  9    Marks - 10
Which of these is data type long literal?     
Options    
0x99fffL    
ABCDEFG    
0x99fffa    
99671246

Question No.  10    Marks - 10
Which of these can be returned by the operator &?     
Options    
Integer    
Boolean    
Character    
Integer or Boolean

Question No.  11    Marks - 10
Literals in java must be preceded by which of these?    
Options    
L    
l    
D    
L and I


Solve by www.solvezone.in contact for more details at 8882309876


Question No.  12    Marks - 10
Which of these cannot be used for a variable name in Java?     
Options    
identifier    
keyword    
identifier & keyword    
None of these

Question No.  13    Marks - 10
Which of these are selection statements in Java?     
Options    
if()    
for()    
continue    
break

Question No.  14    Marks - 10
Which of these jump statements can skip processing remainder of code in its body for a particular iteration?    
 Options    
break    
return    
exit    
continue    

Question No.  15    Marks - 10
Which of the following can be operands of arithmetic operators?    
 Options    
Numeric    
Boolean    
Characters    
Both Numeric & Characters

Question No.  16    Marks - 10
Decrement operator – decreases value of variable by what number?    
 Options    
1    
2    
3    
4

Question No.  17    Marks - 10
What is the process of defining more than one method in a class differentiated by method signature?    
 Options    
Function overriding    
Function overloading    
Function doubling    
None of these

Question No.  18    Marks - 10
Which of the following is a method having same name as that of its class?     
Options    
finalize    
delete    
class    
constructor

Question No.  19    Marks - 10
Which method can be defined only once in a program?    
Options    
main method    
finalize method    
static method    
private method    

Question No.  20    Marks - 10
Which of these statement is incorrect?     
Options    
All object of a class are allotted memory for the all the variables defined in the class.
If a function is defined public it can be accessed by object of other class by inheritation.
main() method must be made public.    
All object of a class are allotted memory for the methods defined in the class.

Question No.  21    Marks - 10
Which of this keyword must be used to inherit a class?     
Options    
super    
this    
extent    
extends

Question No.  22    Marks - 10
Which of these keywords is used to refer to member of base class from a sub class?     
Options    
upper    
super    
this    
lower

Question No.  23    Marks - 10
A class member declared protected becomes member of subclass of which type?     
Options    
public member    
private member    
protected member    
static member

Question No.  24    Marks - 10
Which of these is correct way of inheriting class A by class B?     
Options    
class B + class A {}    
class B inherits class A {}    
class B extends A {}    
class B extends class A {}    

Question No.  25    Marks - 10
Which of the following statements are incorrect?     
Options    
public members of class can be accessed by any code in the program.    
private members of class can only be accessed by other members of the class.    
private members of class can be inherited by a sub class, and become protected members in sub class.    
protected members of a class can be inherited by a sub class, and become private members of the sub class.

Question No.  26    Marks - 10
Which of these keywords is used to define packages in Java?    
Options    
pkg    
Pkg    
package    
Package

Question No.  27    Marks - 10
Which of these is a mechanism for naming and visibility control of a class and its content    
Options    
Object    
Packages    
Interfaces    
Exception Handling,    

Question No.  28    Marks - 10
Which of these access specifiers can be used for a class so that it’s members can be accessed by a different class in the different package?    
Options    
Public    
Protected    
Private    
No Modifier

Question No.  29    Marks - 10
Which of the following is correct way of importing an entire package ‘pkg’?    
Options    
import pkg.    
Import pkg.    
import pkg.*    
Import pkg.*

Question No.  30    Marks - 10
Which of the following is incorrect statement about packages?     
Options    
Package defines a namespace in which classes are stored.    
A package can contain other package within it.    
Java uses file system directories to store packages.    
A package can be renamed without renaming the directory in which the classes are stored.

Question No.  31    Marks - 10
Which of these keywords must be used to handle the exception thrown by try block in some rational manner?     
Options    
try    
finally    
throw    
catch

Question No.  32    Marks - 10
Which of these packages contains all the classes and methods required for even handling in Java?     
Options    
java.applet    
java.awt    
java.event    
java.awt.event

Question No.  33    Marks - 10
Which of these classes is super class of all the events?     
Options    
Event Object    
Event Class    
Action Event    
Item Event

Question No.  34    Marks - 10
Which of these events will be generated if we close an applet’s window?    
Options    
ActionEvent    
ComponentEvent    
AdjustmentEvent    
WindowEvent


Question No.  35    Marks - 10
Which of these is a protocol for breaking and sending packets to an address across a network?    
TCIP/IP    
DNS    
Socket    
Proxy Server    

Question No.  36    Marks - 10
How many ports of TCP/IP are reserved for specific protocols?     
Options    
10    
1024    
2048    
512

Question No.  37    Marks - 10
Which of these is a full form of DNS?     
Options    
Data Network Service    
Data Name Service    
Domain Network Service    
Domain Name Service

Question No.  38    Marks - 10
Which of these classes is used to encapsulate IP address and DNS?    
Options    
Datagram Packet    
URL    
InetAddress    
Content Handler

Question No.  39    Marks - 10
Which of these keywords is not a part of exception handling?     
Options    
try    
finally    
thrown    
catch

Question No.  40    Marks - 10
Which of the following package stores all the standard java classes?     
Options    
lang    
java    
util    
java.packages