All Matches
Solution Library
Expert Answer
Textbooks
Search Textbook questions, tutors and Books
Oops, something went wrong!
Change your search query and then try again
Toggle navigation
FREE Trial
S
Books
FREE
Tutors
Study Help
Expert Questions
Accounting
General Management
Mathematics
Finance
Organizational Behaviour
Law
Physics
Operating System
Management Leadership
Sociology
Programming
Marketing
Database
Computer Network
Economics
Textbooks Solutions
Accounting
Managerial Accounting
Management Leadership
Cost Accounting
Statistics
Business Law
Corporate Finance
Finance
Economics
Auditing
Ask a Question
Search
Search
Sign In
Register
study help
computer science
advanced java programming
Questions and Answers of
Advanced Java Programming
Which of these packages contain classes and interfaces used for input and output operations of a program?(a) java.util.io(b) java.lang.io(c) java.io(d) java.lang
How would you determine the MIME type of a file?
Which of these methods of InputStream is used to read integer representation of the next available byte input?(a) getInt()(b) read()(c) readInt()(d) getInteger()
Show the list of all file names from a folder.
Which of these classes is used for input and output operation when working with bytes?(a) Bytes(b) Reader(c) Writer(d) InputStream
Write a program to get the list of all files from a folder.
Which of these classes is not a member class of java.io package?(a) Integer(b) Reader(c) Writer(d) StringReader
How do you read file content using byte array?
Which of these classes is used to read bytes from a file?(a) FileReader(b) FileWriter(c) FileInputStream(d) InputStreamReader
Write the steps needed to read file content line by line in Java?
Which of the following data types is returned by every method of OutputStream?(a) int(b) float(c) byte(d) None of the mentioned
Write an example that counts the number of times a particular character, such as e, appears in a file.The character can be specified at the command line. You can use xanadu.txt as the input file.
Which of these interfaces is not a member of Java.io package?(a) DataInput(b) ObjectInput(c) ObjectFilter(d) FileFilter
Explain the steps required to read property file in static context.
Which of the following is a method of ObjectOutput interface used to finalize the output state so that any buffer is cleared?(a) clear()(b) flush()(c) fflush()(d) close()
How do you read input from console in Java?
Which of these is a method of ObjectOutput interface used to write the object to input or output stream as required?(a) write()(b) print()(c) StreamWrite()(d) writeObject()
Write a program to get file list from a folder filtered by extension .java?
Which of the following is a method to clear all the data present in output buffers?(a) clear()(b) flush()(c) fflush()(d) close()
How do you get file URI reference?
Which of the following classes is used to read characters in a file?(a) FileReader(b) FileWriter(c) FileInputStream(d) InputStreamR
When invoking format, what is the best way to indicate a new line?
Which of these methods is used for writing bytes to an outputstream?(a) put()(b) print()(c) printf()(d) write()
How do you store and read objects from a file?
Which of the following classes is not related to input and output stream in terms of functioning?(a) File(b) Writer(c) InputStream(d) Reader
Write a program to create and store property file dynamically?
Which of the following is specified by a File object?(a) A file in disk(b) Directory path(c) Directory in disk(d) None of the mentioned
How do you store property file as xml file?
Which of these is an interface for control over serialization and deserialization?(a) Serializable(b) Externalization(c) FileFilter(d) ObjectInput
Filter the files by file extensions and show the file names.
Which of these methods of FileReader class is used to read characters from a file?(a) Read()(b) Scanf()(c) Get()(d) GetInteger()
How do you get file last modified time?
What is the output of this program?(a) H(b) Hello(c) Runtime Error(d) Compilation Error import java.util.*; public class genericstack { Stack stk = new Stack (); public void push (E obj) { stk.push
What will be the output of the program?(a) Compilation error.(b) finished(c) Exception(d) Arithmetic Exception public class Test { public static void main(String[] args) { try { 3 int x = 0; int y =
What is the difference between Parallel and Paralle compact Garbage collector?
Identify those types that cannot be used as type arguments.
What is the output of this program?(a) H(b) Hello(c) Runtime Error(d) Compilation Error import java.util. *; public class genericstack { Stack stk = new Stack (); public void push (E obj) { }
What is the output of this program?(a) 0(b) 36(c) Runtime Error(d) Compilation Error import java.util.*; public class genericstack { Stack stk = new Stack (); public void push (E obj) { stk.push
Briefly explain the concept of ‘type erasure’?
Will the following method compile? If not, why? public static void print (List
What is the output of this program?(a) Error(b) Hello(c) 36(d) Hello 36 import java.util.*; public class genericstack { Stack stk= new Stack (); public void push (E obj) { stk.push(obj); } public E
Given the following classes:Will the following code compile? If not, why? class Shape { /*... */ } class Circle extends Shape { /* class Rectangle extends Shape { /* class Node { /* ... */ } */ } */ }
Which syntax would you use to express a wildcard with a lower-bound of some type?(a) ?(b) ? extends type(c) ? super type(d) None of the above
Write the tasks performed by type erasure.
What is an “unchecked” warning message?
Which syntax would you use to express a wildcard with an upper-bound of some type?(a) ?(b) ? extends type(c) ? super type(d) None of the above
When was generics first introduced in Java?(a) JDK 1.4(b) JDK 1.5(c) JDK 1.6(d) JDK 1.7
Which of the following character pairs are used to write type parameters?(a) (b) {}(c) [](d) ()
Which of these packages contains reflection classes and interfaces?(a) Java.reflection (b) Java.reflect(c) Java.lang.reflection(d) Java.lang.reflect
Write the mangled names that represent a twodimensional array.
Which of the following is used to get the type of object represented by “obj”?(a) Classloader.getInstance(obj);(b) Obj.getClass().getName();(c) Obj.toString();(d) New Class.getName(obj);
Write the names of some popular software where Java reflection is used.
What does the following program segment do?(a) The first 5 member variables of myClass are copied to “res”.(b) The value of myClass.count is set to 5.(c) 5 copies of the myClass object are
How can you construct an object of a given class using reflection?
Write a program that finds and displays inheritance hierarchy of a specified class.
What is primary class in reflection?(a) Reflection(b) Reflect(c) Class(d) Primary
Write the different ways with their relative merits and demerits to get the Class object?
Which of the following methods on an object is used to get a Class object representing the object’s type?(a) GetClass()(b) GetType()(c) Type()(d) Class()
What is the primary purpose of Modifier class?
How do you get a Class object for primitive types?(a) [I](b) I]](c) 2[I(d) [[I
Using reflection, how can you tell if a member is public or private?
Which of the following returns a Class for an array of
How will you to retrieve modifier’s information of a class
The total number of modifiers used for class/interface, fields, methods and constructors is(a) 10(b) 11(c) 12(d) 13
There is no explicit constant which corresponds to “package” access. So, how will you identify it?
What value does classModifiers() return?(a) 3103(b) 7(c) 3391(d) 223
Write some of the methods that are used to get information about a class.
What value does fieldModifiers() return?(a) 3103(b) 7(c) 3391(d) 223
What value does methodModifiers() return?(a) 3103(b) 7(c) 3391(d) 223
What is the difference between getDeclaraedFields()and getFields()?
What value does constructorModifiers() return?(a) 3103(b) 7(c) 3391(d) 223
Write a program that shows all public fields of a specified class.
Which of the following methods is used to call a method using reflection?(a) Call()(b) CallMethod()(c) Invoke()(d) InvokeMethod()
Explain how you will modify final fields.
Which of the following methods is used to create an instance of a class?(a) NewObject()(b) CreateInstance()(c) CreateObject()(d) NewInstance()
Provide a simple example of object reflection in Java.
Which of the following modifiers cannot be used for a class?(a) Public(b) Final(c) Abstract(d) Volatile
Is Java reflection slow and/or expensive?What are some of the drawbacks of reflection in Java?
Which of the following methods is used when modifying final fields?(a) SetField()(b) SetAccessible()(c) MakeAccessible()(d) MakeModifiable()
Write some practical uses of Java reflection?
Which of the following methods is used to find the list of interfaces a class implements?(a) GetGenericInterfaces()(b) GetInterfaces()(c) FindGenericInterfaces()(d) Interfaces()
Which of the following classes represents an invocation handler?(a) Java.reflect.InvocationHandler(b) Java.InvocationHandler(c) Java.lang.reflect.InvocationHandler(d) Java.lang.reflect.Handler
Which of the following methods is used to create a dynamic proxy?(a) GetProxyInstance()(b) GetProxy()(c) CreateProxyClass()(d) GetProxyClass()
Which of the following is used to create an instance of an array using reflection?(a) Array.newInstance()(b) Array.instance()(c) Array.createArray()(d) Array.createInstance()
Which one of the following methods is called first on a servlet?(a) Java Native Implementation(b) Java Normalized Interface(c) Joint Native Interface(d) Java Native Interface
Explain the advantages and disadvantages of using JNI.
Which of the following keywords is used to declare a method as native method?(a) Primitive(b) NativeMethod(c) Native(d) OldMethod
Mention some situations when we should use JNI.
Which of the following names will you use in loadLibray method in Linux if the name of a shared library is libtest.so?(a) Test(b) Libtest(c) Lib(d) Libtest.so
Write the basic steps required to write a JNI application.
Which of the following names will you use in loadLibray method in Windows if the name of a shared library is libtest.so?(a) Lib.dll(b) Libtest.dll(c) Test.dll(d) Libtest.so
How do you load a native shared library in JVM?
Which of the following languages is used as native language?(a) C(b) C++(c) Both C and C++(d) None of the above
What is the difference between loadLibrary() and load() method?
Which of the following methods is used to load a shared library?(a) GetLibrary()(b) LibraryLoad()(c) InstallLibrary()(d) LoadLibrary()
What is the function of javah tool?
Describe the procedure to generate header files using javah.
Which of the following Java tools is used to create native function signature?(a) Javah(b) Javac(c) Javas(d) Javap
Explain why function call syntax is different in C and C++.
If the name of the class files is test, what will be the name of the header file generated?(a) test.h(b) java_test.h(c) native_test.h(d) native.h
Showing 800 - 900
of 1226
1
2
3
4
5
6
7
8
9
10
11
12
13