What is Java Method Area?

Ayyan
Updated on 30-Jul-2019 22:30:21

2K+ Views

JVM has a method area common across all the threads. It contains per-class elements like constant pool, fields, method local data, method code, constructor codes etc. which are used in class and initialization of objects/interfaces.This method area gets created during JVM start-up. It is generally part of Heap area. It could be of fixed size or vary. Its memory may not be contiguous. JVM implementation can give control to programmer over Method area creation, its sizing etc. If method area memory is not sufficient to satisfy an allocation request then JVM throws OutOfMemoryError.

Can a Vector contain heterogeneous objects in Java?

Ramu Prasad
Updated on 30-Jul-2019 22:30:21

1K+ Views

Since a vector stores elements in the form of objects, you can store objects of various types (heterogeneous) in it.Example:import java.util.*; class Demo{} public class VectorSample {    public static void main(String args[]) {       Demo obj = new Demo();       Vector v = new Vector(3, 2);       System.out.println("Initial size: " + v.size());       System.out.println("Initial capacity: " + v.capacity());       v.addElement(new Integer(1));       v.addElement(new String("krishna"));       v.addElement(new Float(3.5f));       v.addElement(obj);       System.out.println("Capacity after four additions: " + v.capacity());    } }

Checking for Null or Empty or White Space Only String in Java.

Anjana
Updated on 30-Jul-2019 22:30:21

2K+ Views

We can verify whether the given string is empty using the isEmpty() method of the String class. This method returns true only if length() is 0. Example import java.lang.*; public class StringDemo {     public static void main(String[] args) {         String str = "tutorialspoint";         // prints length of string         System.out.println("length of string = " + str.length());         // checks if the string is empty or not         System.out.println("is this string empty? = " + str.isEmpty());     } } Output length of string = 14 is this string empty? = false

Getting data in front-end tools from SAP HANA database

Anil SAP Gupta
Updated on 30-Jul-2019 22:30:21

447 Views

In SAP HANA database, you have different system schema. _SYS_BIC schema in SAP HANA database is used to store column views of all the activated objects in HANA repository. When an object is created and activated (HANA Modeling views, Stored Procedures), run time objects are saved under _SYS_BIC/Column views in database.These column views are used by front-end tools like BusinessObjects to get the data in a query.

Updating configuration property file in SAP HANA Remote source

Anil SAP Gupta
Updated on 30-Jul-2019 22:30:21

477 Views

Note that while modifying or creating the property configuration file, only the property which is different from default value needs to be set. The mistake in property configuration file may result in incorrect action or result of data source.

What does the method add(E element) do in java?

Nikitha N
Updated on 30-Jul-2019 22:30:21

536 Views

The add(E e) method of the java.util.ArrayList class appends the specified element E to the end of the list.Example:import java.util.ArrayList; public class ArrayListDemo {    public static void main(String[] args) {       ArrayList arrlist = new ArrayList(5);       arrlist.add(15);       arrlist.add(20);       arrlist.add(25);       for (Integer number : arrlist) {          System.out.println("Number = " + number);       }    } }Output:Number = 15 Number = 20 Number = 25

When to use LinkedList over ArrayList in Java

Paul Richard
Updated on 30-Jul-2019 22:30:21

3K+ Views

LinkedList should be used where modifications to a collection are frequent like addition/deletion operations. LinkedList is much faster as compare to ArrayList in such cases. In case of read-only collections or collections which are rarely modified, ArrayList is suitable.

Which one is faster Array or List in Java

Moumita
Updated on 30-Jul-2019 22:30:21

950 Views

The array is faster in case of access to an element while List is faster in case of adding/deleting an element from the collection.

How can we apply AUTO_INCREMENT to a column?

George John
Updated on 30-Jul-2019 22:30:21

216 Views

AUTO_INCREMENT means that the column will get the value automatically. To illustrate it we have created a table ‘employees’ as follows − mysql> Show Create Table employees\G *************************** 1. row *************************** Table: employees Create Table: CREATE TABLE `employees` ( `Id` int(11) NOT NULL AUTO_INCREMENT, `Name` varchar(35) DEFAULT NULL, PRIMARY KEY (`Id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 1 row in set (0.00 sec) From the above result set, we can see that column id is given the auto-increment option. Now, when we will insert the value in Name ... Read More

Functions of Index server in SAP HANA system

Anil SAP Gupta
Updated on 30-Jul-2019 22:30:21

628 Views

Index Server is heart of SAP HANA system and is responsible for processing all SQL statements sent to HANA database. This server contains SQL/MDX Processing engine that is responsible to process and analyze data in HANA db.Index Server also contains Persistence layer for scalability and restoration of the system. In case of system failure, power failure or database corruption, Persistence layer is responsible for the restoration of HANA system to last save point.When you are running complex and large calculations, and there is a system failure Persistence layer is used to ensure that transactions are either fully executed or complete ... Read More

Advertisements