affiliate marketing

Tuesday 5 June 2012

JAVA PROGRAMMING QUESTION BANK PART 2

UNIT-2
2-MARKS
1.What are objects?
2.What is a class?(define class)
3.What are instance variables?
4.Give the general form of method declaration?
5.How object are created in C++ and java>Explain with eg.
6.How to access class members of a class?
7.Define constructors?
8.Explain the usage of constructors?
9.What is method overloading?
10.What is static variable?
11.Explain static methods?
12.What ios nesting of methods w.r.t java?
13.What are the types of inheritance possible in java?
14.Explain the usage of inheritance?
15.What is function overloading?
16.When a variable is called a “final” variable and what is its use?
17.What are final methods and final classes?
18.What is finalization?


19.Define abstract class?
20.What are the different access specifies?
21.What are array?
22.Define 1-dimentional and 2-dimentional array?
23.How to create an integer array which can hold 10 values?
24.How to create an array that hold 20 names of persons?
25.How to create variable size arrays?
26.Differentiate string and string buffer class?
27.Give eg for 4 methods of string class?
28.What are wrapper classes?
29.Give some 4 methods of string buffer class?
30.Give an eg to convert object nos to primitive nos?
31.Give an eg to convert primitive nos to object nos using constructor methods?
32.What is the methods to convert number to strings?Give eg.
33.How to convert string to numeric objects?
34.How to convert string to primitive numbers?
35.How does java handle strings?
35.How are wrapper classes useful?
36.Find errors if any rectify it.
int m;
int []y=int [11];
int x[]=int [10];
x=y=new int[20];
38.Explain garbage collection?
39.How does subclass call its base class constructors? Give eg.
40.Why multiple inheritance of classes is not there in java?
41.What are the 3 parts of a simple , empty class?

10MARKS

1.Explain
a. define a class (3).
b. adding variable and methods.(4)
c. creating objects.(3)
2.Explain 
a. usage of constructors
b. how constructors are being called in inheritance
c. types of constructors.
3.Explain inheritance concept?
4.Explain
a. creating an array.
b. initializing an array.
c. variable size array.
with suitable eg.
5.Explain some 10 methods of string classes?
6.Explain some 10 methods of string buffer class?
7.Explain wrapper classes?
8.Explain var, static block and static methods with suitable eg.
9.Explain in detail about visibility control in java?
10.Compare and contrast overloading and overriding methods in java?
11.Design a class to rep a bank account. Include the following members
Data members:
*Name of depositor.
*account number.
*type of account.
*balance amount in the account.
Methods:
*to assign initial values.
*to deposit an amount.
*to withdraw an amount after checking balance
*to display the name and balance.
12.Write the program to depict hierarchical inheritance?
13.An election is conducted by 5 candidates. the candidates are numbered 1 to 5 and the voting is done by marking the candidate number on the ballot paper. WAP to read the ballot and count the votes by each candidates. In case a number read is outside the range 1 to 5,the ballot should be considered as a spoilt ballots.
15.Given are two 1-dimentional array A and B which are sorted in ascending order. WAP to merge them into a single sorted array C that contains every item from arrays A and B,in ascending order.
16.WAP to do the following.
a.print”who is the inventor of java”.
b.to accept an answer.
c.to print “good” and then stop if the answer is correct.
d.print”try again” , if the answer is wrong.
e.to display the correct answer when the answer is wrong even at the third attempt and stop.
17.WAP to extract a portion of a char string and print the exracted string.Assume that m char are extracted, starting with the ‘n’th char.
18.WAP which will read a text and count all occurrences of a particular word?
19.WAP which will read a string and rewrite it in the alphabetical order.for eg .
STRING should be written as GNIRTS.
20.The annual exam result of 100 students are as follows
------------------------------------------ 
R.NO SUB1 SUB2 SUB3
------------------------------------------ 
.
.
.
------------------------------------------- 
WAP to read the data and determine the following.
a.total marks obtained by each student.
b.the highest marks obtained in each subject and rollno of the student who secured it.
c.the student who obtained the highest total marks. 

********************


No comments:

Post a Comment