|
1) What is method in java? How to define and call
the method?
Method is a programming construct used for grouping the statement together to build a function. There are two ways by which the method is handled. 1. Defining a method 2. Calling a method Here is example that helps to understand the concept of method defining and calling. public class methDemo {
2) What are the different access identifiers? There are main three access identifiers:-public, private
and protected.
3) What do you mean by void method? Void method means it returns nothing or it doesn’t return
any kind of data from that method.
4) Describe various methods in Math class. In java, Math class is an useful class for performing
basic mathematical operations. Various methods available in Math class
are:
5) What is array? How to declare array and how to allocate the memory to for array? Array is a collection of similar type of elements. Thus grouping of similar kind of elements is possible using arrays. Typically arrays are written along with the size of them. The syntax of declaring array is: data_type array_name [];
where array_name represent name of
the array, new is a keyword used to
6) Explain how to declare Two Dimensional array? The two dimensional arrays are the arrays in which elements are stored in rows as well as columns. For example: 10 20 30
The two dimensional array can be declared and initialized as follows Syntax: data_type array_name=new data_type[size];
7) What is OOP? Give some detail. 1. Object Oriented Programming is a programming language model organized around “objects” rather than “actions”. 2. The focus of the object oriented programming is data. 3. The first step in OOP is to identify all the objects you want to manipulate. Then is identified that how they relate to each other. This procedure is known as data modeling. 4. The identified object is generalized as class of objects and defines the kind of data it contains and any logic sequences that can manipulate it. Each distinct sequence is known as a method or functions. 5. An instance of a class is called as an “object”. 6. The programming language like C tends to focus on actions or procedures whereas java is object oriented programming language. 7. In C the unit of programming is procedures whereas in java the unit of programming is class from which the object is instantiated. 8. In java the user defined classes are created. |
|
See also
Ask It in The Java Forum Java Books
Return to : Java Programming Hints and Tips All the site contents are Copyright © www.erpgreat.com
and the content authors. All rights reserved.
|