Java J2EE Interview Questions
Questions Answers Views Company eMail

Hi Friends, Can u give few interview questions which relates ArrayList and Hashmap. I mean how to link ArrayList and HashMap.I know this is not good way of asking questions like this , but i need

Microsoft, Wipro,

1 4024

cud u help me ... i am struggling with this question... to find all the subsets of a given set for ex.... a,,b,c shud give all the subsets.... i gt the program in c bt nt able to get it in java..... help needed ..

1732

Main reasons for using servlet as a controller in struts. why not jsp

5 6460

Can u write constructor in abstract.If yes den when it will be invoked.

SunGard,

4 9434

Can u overload main()method.Give with example.

IBM, Schimatic Technologies,

6 26916

without session Id can we do any operations like add,update,edit,delete. I saw Session id is loaded for edit and delete action not for add .so am asking this

Syntel,

1 4355

Hi friends am new to java. I read jar file means collection of java files. For executing struts application what are the necessary jar files. " struts.jar " file contains what. can u explain

1428

How will you serialize a singleton class without violating singleton pattern?

1517

How will you override default serialization mechanism in java

2 7444

Can we place the any object to key attribute of HashMap?

HCL,

4 17457

Hi friends, i am new to java. can you explain how java is secured.

2 3464

I want to use the markerfor playing a video using the jmf.Suppose my video length is of 2 hours.I want it to play ex-15 mintue or 20 mintue and should stop after assigning the time.I am providing my piece of code............please help me.... package com.jha.cdac.lila.praveen; import java.awt.BorderLayout; import java.awt.Component; import java.awt.Container; import java.awt.Dimension; import java.awt.Toolkit; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import java.io.File; import java.net.URL; import javax.media.ControllerAdapter; import javax.media.Manager; /** * * @author vinays */ import javax.media.Player; import javax.media.RealizeCompleteEvent; import javax.media.Time; import javax.swing.JFrame; public class PlayVideo extends javax.swing.JFrame{ Player player; Component center; Component south; // this code is required for playing the video file of mpeg,mp4,mp3,3gp,rm,flv, //wmf,mpv,vob,qt and the asf extension public PlayVideo() { File file = new File("Lesson1.mpg"); try { load(file); // load() } catch (Exception ex) { //Logger.getLogger(LessonNarrative.class.getName ()).log(Level.SEVERE, null, ex); System.out.println("Error while loading file............"+ex); } } //the piece of code given below is used to load the file which user want to play. public void load(final File file) //load the file throws Exception { URL url = file.toURL(); final Container contentPane = getContentPane(); if (player != null) { player.stop(); } // MediaLocator mediaLocator=new MediaLocator (file.toURL()); // DataSource dataSource=Manager.createDataSource (mediaLocator); // player=Manager.createPlayer(url); player = Manager.createRealizedPlayer(url); ControllerAdapter listener = new ControllerAdapter() { @Override public void realizeComplete( RealizeCompleteEvent event) { Component vc = player.getVisualComponent(); player.getVisualComponent(); if (vc != null) { contentPane.add(vc, BorderLayout.CENTER); center = vc; } else { if (center != null) { contentPane.remove(center); contentPane.validate(); } } Component cpc = player.getControlPanelComponent(); if (cpc != null) { contentPane.add(cpc, BorderLayout.SOUTH); south=cpc; } else { if (south != null) { contentPane.remove(south); contentPane.validate(); } } pack(); // //setTitle(file.getName()); //to get the title of Video or Audio File } }; Time tm=new Time(30.4402403); Time tm1=new Time(5.7256199); player.addControllerListener(listener); player.setMediaTime(tm1); player.setStopTime(tm); // player.setMediaTime(new Time(5.0)); //player.setStopTime(new Time(73)); player.realize(); player.start(); } public static void main(String args[]) throws ClassNotFoundException { PlayVideo pv = new PlayVideo(); JFrame f = new JFrame("Lesson1"); f.addWindowListener(new WindowAdapter() { @Override public void windowClosing(WindowEvent e) { System.exit(0); } }); f.getContentPane().add("Center", pv); f.pack(); Dimension screenSize = Toolkit.getDefaultToolkit ().getScreenSize(); int w = 420; int h = 140; pv.setLocation(screenSize.width/2 - w/2, screenSize.height/2 - h/2); pv.setSize(w, h); pv.setVisible(true); }

3858

When i m clicking on next another frame is open but i want to hide the previous frame...........but it is not happening....still both frame are visible........how to make one frame to hide.......please help me.......

9 12898

Please can you tell me ,where can we used the MVC other than web applications.

1 3044

How display data base errors on web console by using the Struts Framework?

2 6129


Un-Answered Questions { Java J2EE }

hi actully i hav form columns with origin and destination names .as like as i need to create one more column with name amount. my requirement is when i select origin and destination columns automatically i need to get amount from database.how can i. please tel me with relative code

2278


What is difference between path and classpath?

556


How many types of association mapping are possible in hibernate?

167


Differentiate between the constructors and methods in java?

499


Why is my jms work not part of a user transaction (i.e., Called within a transaction but not rolled back appropriately)? How do I track down transaction problems?

451






How to connect to a remote database using Applet?

2040


What are parameters in a method?

581


What is spring rowmapper?

152


What is jms in spring?

473


Explain aggregation in java?

543


What are the main components of JDBC ?

572


What are different Struts2 tags? How can we use them?

568


Write the code that maps the java object with the database tables?

233


Match the ejb functions given below with the functionality equivalent in sql?

547


Is java procedural or object oriented?

459