Posts

Write a java program that writes objects of Employee class in the file named emp.doc. Create Employee class as of you interest.

 import java.io.*; class Employee implements Serializable { private String name; private int age; public Employee(String name, int age) { this.name = name; this.age = age; } @Override public String toString() { return "Name:" + name + " Age:" + age; } } class RWObject { public static void main(String[] args) { Employee employee1 = new Employee("Arjun", 20); Employee employee2 = new Employee("Ram", 20); try { FileOutputStream fileOutputStream = new FileOutputStream("emp.doc"); ObjectOutputStream objectOutputStream = new ObjectOutputStream(fileOutputStream); //Write object to file objectOutputStream.writeObject(employee1); objectOutputStream.writeObject(employee2); objectOutputStream.close(); fileOutputStream.close(); FileInputStream fileInputStream = new FileInputStream("emp.doc"); ObjectInputStream objectInputStream = new ObjectInputStream(fileInputStream); //Read Objects Employee employee = (Employee) objectInputStream.readOb

Discuss various scopes of JSP objects briefly. Create HTML File with principal, time and rate. Then crate a JSP file that reads values from the HTML form, calculates simple interest and displays it.

   SCOPE OF JSP OBJECTS The availability of a JSP object for use from a particular place of the application is defined as the scope of that JSP object. Every object created on a JSP page will have a scope.  Object scope in JSP is segregated into four parts and they are page, request, session, and application. a) Page Scope- page scope means, the JSP object can be accessed only from within the same page where it was created. JSP implicit objects out, exception, response, pageContext, config, and page have page scope. //Example of JSP Page Scope <jsp:useBean id="employee" class="EmployeeBean" scope="page" /> b) Request Scope-  A JSP object created using the request scope can be accessed from any pages that serves that request. More than one page can serve a single request. Implicit object request has the request scope. //Example of JSP Request Scope <jsp:useBean id="employee" class="EmployeeBean" scope="request" /> c

Write a java program to create login with user id, password, ok button, and cancel button. Handle key events such that pressing 'l' performs login and pressing 'c' clears text boxes and puts focus on user id text box. Assume user table having fields Uid and Password in the database named account. (10)

LoginFrame.java  import javax.swing.*; import java.awt.*; import java.awt.event.*; import java.sql.SQLException; /** * JFrame to handle key events such that pressing 'l' performs login, * ... and pressing 'c' clears text fields and puts focus on user ID * ... text field. */ public class LoginFrame extends JFrame { JLabel userIdLabel, passwordLabel; JTextField userIdTextField; JPasswordField passwordField; JButton okBtn, cancelBtn; JFrame self; public LoginFrame() { self = this; userIdLabel = new JLabel("User ID"); passwordLabel = new JLabel("Password"); userIdTextField = new JTextField(20); passwordField = new JPasswordField(20); okBtn = new JButton("OK"); cancelBtn = new JButton("Cancel"); okBtn.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { new JFrame() { { JLabel messageLabel = new JLabel(); LoginService loginService = new LoginService(); String user = userIdTextField.getText();

Define group. State different stages in group formulation process.

Image
 Group  A group is defined as a collection of two or more two people working together to achieve common objectives. Such groups are set of interacting and interdependent people having a common belief on at least one particular objective. There can be several purposes for formulating the groups and hence there can be different types of groups in the organization. For our purpose here, groups are taken as workgroups. Such groups are the basic building blocks of every organization as the productivity of the organization can be scaled high with effective mobilization of workgroups. Workgroups form and follow roles, rules, and norms to control members' behavior. Groups contribute to organizational effectiveness when group goals are aligned with organizational goals. Stephen Robbins - " A group is defined as two or more individuals Interacting and inter-dependent  David  H. Smith - "A group is two or more freely interacting individuals who share a common Identity who have come

State any four qualities of good leadership.

Image
 QUALITIES OF GOOD LEADERSHIP A person requires personal, psychological, mental, emotional, conceptual, technical, behavioral, and managerial qualities to be an effective leader. A leader should have a clear vision, a desire of learning new knowledge, and the capacity of understanding human behavior. A leader must be social, cooperative, and initiative. To be a successful leader, the following important qualities are required:  a. Physical fitness: Leaders should be physically fit and in a good fit of health. They should have full of energy, vigor, vitality, and enthusiasm. They should be willing to work hard to attain the organizational goal. Physical fit leaders are well trusted by followers. b. A clear sense of purpose: Every leader must have the ability to define and share the vision, mission, and objectives with their followers. A leader must be clear about the vision, mission, and purpose of an idea, priority, and process. If the leader is not clear, followers cannot be convince

State any four features of leadership.

Image
 FEATURES OF LEADERSHIP Leadership has the following common features: 1. Leaders and Followers: Leadership is the essence of the relationship between leaders and followers. Managers or supervisors who influence the subordinates are leaders whereas those who follow or obey the order, command, or direction of leaders are followers. There must be followers for an individual to be a leader. No one can be a leader without having followers. 2  Ability to influence: Leadership is the ability to influence the behavior and efforts of followers. Leaders by position cannot be effective if they cannot influence their subordinates. Here, influencing people means making them ready to obey the order, instructions, and directions without delay. Leaders influence the employee's behavior through power relations, motivation, role modeling, etc.  3. Common objectives: Leaders and followers should have common objectives and goals i.e. the organizational goal. They must be guided by the organizational

Define leadership. Leadership is the nerve of organization. Comment the statement.

Image
 Leadership  Leadership is the art of influencing subordinates to direct their will, abilities, and efforts for the achievement of predetermined organizational objectives.  Stephen Robbins: " Leadership is the ability to influence a group towards achievement of goals."  James Stoner: "Leadership is the process of directing and Influencing the task-related activities of group members " Koontz & Weihrich: "Leadership is defined as an influence, which is the art or process of influencing people so that they will strive willingly and enthusiastically towards the achievement of group goals."   Leadership is the nerve of the organization as we can say that Subordinates are the main concern of organizational leadership. Organizational leadership is an act of setting goals for both individuals and groups of people involved in the organization. Leadership is the essence of the organized vision and dedication of the individual. Leadership, in addition, is the