Directory Image
This website uses cookies to improve user experience. By using our website you consent to all cookies in accordance with our Privacy Policy.

What are core Java interview questions?

Author: Shwetha Manivanan
by Shwetha Manivanan
Posted: Jan 08, 2022

Java has significant advantages compared to other languages and environments that make it suitable for almost all programming tasks.

Java benefits are as follows:

Java Interview Questions is easy to learn.

Java is designed to be easy to use and is therefore easy to write, compiled, debug, and learn than other programming languages.

Object-oriented java.

This allows you to create modular programs and code that can be reused.

Java is a platform-independent.

One of the most significant advantages of Java is its ability to move easily from one computer system to another. The ability to run the same program on many different systems is very important for the World Wide Web software, and Java successfully by becoming a platform-independent at the source and binary level.

Because of Javanese resilience, the ease of use, cross-platform capabilities and security features, have become the choice language to provide internet solutions throughout the world.

JAVA ™ performance on AIX® can be increased in several ways.

Use the StringBuffer function instead of a combined string when doing excessive string manipulation to avoid objects that do not need to make objects that eventually have to undergo garbage collection.

Avoid red writing to the Java console to reduce the cost of string manipulation, text formatting, and output.

Avoid the cost of creation and manipulation of objects using primitive types for variables if necessary.

Cache objects are often used to reduce the amount of garbage collection needed, and avoid the need to re-object.

Group's original operation to reduce the number of native Java interface calls (JNI) if possible.

Use the synchronized method only if necessary to limit multitasking in JVM and the operating system.

Avoid asking for garbage collectors except need. If you have to beg, just do it for idle times or noncritical phases.

Use type int, not a long type if possible, because 32-bit operation is run faster than a 64-bit operation.

Declare the method as a final whenever possible. The final method is handled better by JVM.

Use static end keywords when making constants to reduce the number of times variables need to be initialized.

Avoid the reference "CASTS" and "Instanceof" that is not necessary, because casting in Java is carried out at run time.

Avoid using vectors whenever possible when an array is enough.

Add and delete items from the vector end.

Avoid allocating objects in the loop.

Use the I / O buffer and adjust the buffer size.

Use a collection of connections and statements prepared with cache for database access.

Use a collection of connections to the database and reuse the connection rather than open and close the connection.

Maximize and minimize creation and destruction cycles.

Minimize disputes for shared resources.

Minimizes the creation of short-lived objects.

Avoid calling long distance methods.

Use a callback to avoid blocking call distance methods.

Avoid making objects only used to access methods.

Save the synchronized method from the loop.

Save strings and character data as Unicode in the database.

Reorder classpath so the library that is most often used first.

Java monitoring tool

There are several tools that you can use to monitor and identify performance inhibitors in your Java ™ application.

Vmstat.

Provide information about various system resources. It reports statistics on the kernel utas in street queues and in waiting queues, use of memory, paging space, disk I / O, interruptions, system calls, context switches, and CPU activities.

Iostat.

Detailed I / O Information Disk Report.

Topas.

CPU reports, networks, disk I / O, workload managers and process activities.

TPROF.

Application profiles to determine each routine or method of heat, which can be considered a performance problem.

PS -Mo thread.

Shows the CPU where the process or utens are bound.

Java Profilers [-Xrunhprof, Xrunjpa64]

Determine which routine or method is the most widely used.

Java -verbose: GC

Check the impact of garbage collection in your application. It reports the total time spent carrying out garbage collection, the average time per garbage collection, the average memory collected per garbage collection, and the average object collected per garbage collection.

Java tuning for AIX

AIX® has a series of recommended parameters for your Java ™ environment.

Aixthread_Scope = S.

The default value for this variable is S, which indicates the scope of the system width (1: 1).

Aixthread_mutex_debug = off.

Maintain a list of active mutex for use by debugger.

Aixthread_cond_debug = off.

Maintain a list of variables conditions for use by debugger.

Aixthread_rwlock_debug = off.

Maintain an active reciprocal reciprocal key list, condition variable, and read-write key for use by the debugger. When the key is initialized, it is added to the list if it does not yet exist. This list is implemented as a link that is linked, so it looks for it to determine whether there is a key or does not have performance implications when the list becomes large. The problem is exacerbated by the fact that the list is protected by the key, which is held for the duration of search operations. Another call to the subroutine PTHREAD_MUTEX_INIT () must wait when the search is complete. For optimal performance, you must set this debug debug option value to OFF. Their default is active.

SpinlooPtime = 500.

The number of times that a process can rotate on a busy key before blocking. This value is set to 40 by default. If the TPROF command output shows a high CPU usage for check_lock routines, and if the key is usually available in a short time, you must increase the round time by setting a value to 500 or higher.

Rate this Article
Leave a Comment
Author Thumbnail
I Agree:
Comment 
Pictures
Author: Shwetha Manivanan

Shwetha Manivanan

Member since: Jan 05, 2022
Published articles: 1

Related Articles