Question 1
Why public, static, void and arguments in following statement required →public static void main(String args[])Describe Inheritance, Polymorphism and Data Encapsulation characteristics of OOP with example.
Why public, static, void and arguments in following statement required →public static void main(String args[])Describe Inheritance, Polymorphism and Data Encapsulation characteristics of OOP with example.
Create a class called Employee that includes three pieces of information as instance variables—a first name (typeString), a last name (typeString) and a monthly salary (double). Your class should have a constructor that initializes the three instance variables. Provide a set and a get method for each instance variable. If the monthly salary is not positive, set it to 0.0. Write a test application named EmployeeTest that demonstrates class Employee’s capabilities. Create two Employee objects and display each object’s yearly salary. Then give each Employee a 10% raise and display each Employee’s yearly salary again.
Create a class named Account with instance variables Ac_No,Name and Balance and methods display (), setdata (),deposit(). In display () method, display the instance variables value Ac_No,Name and Balance). And in setdata () method set the instance variable values (Ac_No,Name and Balance) and in deposit() method the amount that user wants to deposit that will be deposited.
Create a method named Withdraw () in the main function performing exception handling. Example: Balance = 1000; Withdraw = 12000 Here, Balance
Write a java program to read employee details from emp.txt file and print on screen.
Create customer class which extends thread class and contains two instance variables name, ProductName and static variable Product Quantity. For example if two customers are trying to buy the same product at once then follow synchronization of two customers extending thread class.
Write a java program to read students details from console and write that students details into emp.txt file.
Circulate this solved paper with KaTeX formulas and 1-click AI step solvers to your batchmates on WhatsApp or Telegram.
Official Gujarat Technological University (GTU) examination paper and step-by-step solutions for Object Oriented Programming -I (Java) (Winter 2024, B.E. · Computer Engineering, Sem 4). Features complete 70-mark regular & remedial examination pattern, official marking distribution across all 5 questions, and direct 1-click official PDF download.
Transcribed for student exam preparation from Gujarat Technological University official examination archives. Questions, syllabus guidelines, and curriculum marking schemes remain the intellectual property of Gujarat Technological University.