1.Class,method,object answer
1.Class,method,object answer
DAY1:
-------
1.Java Introduction
2.Class,Method,Object
3.Same package and Different package
QUESTIONS(Theory):
------------
1.What is platform independent?
ANS :
software can run on multiple operating systems and hardware platforms without
significant adjustments.
For example, if you create code on Windows and it can run on Linux, macOS, Unix, or
Solaris without any issues, then it is platform-independent.
JRE:
----
JDK
----
5.What is the latest version of JDK and which version you are using in your
project?
ANS :
latest version of JDK Version 23 and java 11 version using in our project.
6.What is the latest version of eclipse and which version you are using in your
project?
ANS :
latest version of eclipse 2023 and 2023 version you are using in your project
Feature C++
Java
1.Compilation Compiled directly into machine code.
Compiled into bytecode and then interpreted by JVM.
2.Syntax Syntax is closer to low-level languages like Assembly and
C. Syntax is closer to high-level languages like Python and
Ruby.
3.Object-Oriented
Programming Supports both procedural and object-oriented programming.
Purely object-oriented programming language.
4.Memory Management Has manual memory management through pointers.
Has automatic memory management through garbage collection.
5.Performance Faster performance due to direct machine code
execution. Slower performance due to bytecode
interpretation.
6.Template Library Standard Template Library (STL) provides robust and
Java provides collection framework for data structures,
efficient implementation of data structures.
but not as efficient as STL in C++.
7.Platform Dependence Platform-dependent, need to be recompiled for
different systems. Platform-independent, runs on any system with
JVM installed.
8.Multiple Inheritance Supports multiple inheritance
Does not support multiple inheritance, uses interface to achieve
similar functionality.
8.Features of java?
ANS :
Simple
Object-Oriented
Portable
Platform independent
Secured
Robust
Architecture neutral
Interpreted
High Performance
Multithreaded
Distributed
Dynamic
9.What type of tool you are using in your project to execute java?
ANS :
Eclipse. Eclipse is a popular ,open Source (IDE) primarily used for Java
programming.
PACKAGE-> myfirstproject-src-rightclick-new-package
EX: package com.tcs.differentpackage;
14.What gives Java it's "write once and run anywhere" nature?
ANS:
Byte code 0s,1s
QUESTIONS(Programs):
-----------------
QUESTION 1:
------------
Project :EmployeeDetails
Package :org.emp
Class :Employee
Methods :empId(),empName(),empDob(),empPhone(),empEmail(),empAddress()
Description:
Create an object for employee class and call above methods also follow the all
coding standards.
ANSWER:
package org.emp;
QUESTION 2:
-------------
Project :Al-RightAddress
Package :org.add
Class :Al-RightTech
Methods :Al-RightOmr(),Al-RightAdayar(),Al-RightTambaram(),Al-
RightVelacherry(),Al-RightAnnaNagar()
Description:
Create an object for Al-RightTech class and call above methods also follow the all
coding standards.
ANSWER:
package org.add;
}
}
QUESTION 3:
------------
Project :CompanyDetails
Package :org.company
Class :CompanyInfo
Methods :companyName(),companyId(),companyAddress()
Description:
Create an object for CompanyDetails class and call above methods also follow the
all coding standards.
ANSWER:
//Create an object for CompanyDetails class and call above methods also follow the
all coding standards.
package org.company;
QUESTION 4:
-----------
Project :MyPhone
Package :org.phone
Class :PhoneInfo
Methods :phoneName(),phoneimeiNum(),Camera(),storage(),osName()
Description:
Create an object for PhoneInfo class and call above methods also follow the all
coding standards.
ANSWER:
package org.phone;
QUESTION 5:
------------
Project :LanguageDetails
Package :org.lang
Class :LanguageInfo
Methods :tamilLanguage(),englishLanguage(),hindiLanguage()
Class :StateDetails
Methods :southIndia(),northIndia()
Description:
Create an object for LanguageInfo and StateDetails inside the StateDetails class
call both classes methods also follow the all coding standards.
ANSWER:
LanguageInfo
---------------
package org.lang;
StateDetails
-------------
package org.lang;
QUESTION 6:
-----------
Project :EmployeeInformation
Package :org.emp
Class :Employee
Methods :empName()
Package :org.company
Class :Company
Methods :companyName()
Package :org.client
Class :Client
Methods :clientName()
Package :org.project
Class :Project
Methods :projectName()
Description:
Create an object for all 4 classes inside the Employee class and call all classes
methods also follow the all coding standards.
ANSWERS:
package org.emp;
------------------------------
package org.company;
------------------------------
package org.client;
}
---------------------------------
package org.project;
//Create an object for all 4 classes inside the Employee class and call all
classes methods
//also follow the all coding standards.
package org.emp;
import org.company.Company;
import org.client.Client;
import org.project.Project;
QUESTION 7:
-------------
Project :PhoneDetails
Package :org.phone
Class :ExternalStorage
Methods :size()
Class :InternalStorage
Methods :processorName(),ramSize()
Description:
Create an object for ExternalStorage and InternalStorage inside the InternalStorage
class and call both classes methods also follow the all coding standards.
ANSWER:
package org.phone;
---------------------------
package org.phone;
-----------------------------
package org.phone;
QUESTION 8:
------------
Project :CollegeInformation
Package :org.college
Class :College
Methods :collegeName(),collegeCode(),collegeRank()
Class :Student
Methods :studentName(),studentDept(),studentId()
Class :Hostel
Methods :hostelName()
Class :Dept
Methods :deptName()
Description:
Create an object for all 4 classes inside the College class and call all classes
methods also follow the all coding standards.
ANSWER:
package org.college;
------------------------------
package org.college;
------------------------------
package org.college;
---------------------------------
package org.college;
//Create an object for all 4 classes inside the Employee class and call all
classes methods
//also follow the all coding standards.
package org.college;
QUESTION 9:
------------
Project :VehicleInformation
Package :org.allvehicle
Class :Vehicle
Methods :VehicleNecessery()
Package :org.twowheeler
Class :TwoWheller
Methods :bike(),cycle()
Package :org.threewheeler
Class :ThreeWheeler
Methods :Auto()
Package :org.fourwheeler
Class :FourWheeler
Methods :car(),bus(),lorry()
Description:
Create an object for all 4 classes inside the Vehicle class and call all classes
methods also follow the all coding standards.
ANSWER:
package org.allvehicle;
}
----------------------------------------
package org.twowheeler;
------------------------------------------
package org.threewheeler;
----------------------------------------------
package org.fourwheeler;
//Create an object for all 4 classes inside the Vehicle class and
//call all classes methods also follow the all coding standards.
package org.allvehicle;
import org.twowheeler.TwoWheller;
import org.threewheeler.ThreeWheeler;
import org.fourwheeler.FourWheeler;
}
}
QUESTION 10:
--------------
Project :TransportInformation
Package :org.transport
Class :Transport
Methods :TransportForm
Package :org.road
Class :Road
Methods :bike(),cycle(),bus(),car()
Package :org.air
Class :Air
Methods :aeroPlane(),heliCopter()
Package :org.water
Class :Water
Methods :boat(),ship()
Description:
Create an object for all 4 classes inside the Transport class and call all classes
methods also follow the all coding standards.
ANSWER:
package org.transport;
}
---------------------------------------------------
package org.air;
}
---------------------------------------------------
package org.water;
//Create an object for all 4 classes inside the Transport class and call all
classes methods also follow the all coding standards.
package org.transport;
import org.road.Road;
import org.air.Air;
import org.water.Water;
}
}
---------------------
QUESTION 11:
--------------
Project :NetworkInformation
Package :org.network
Class :Wifi
Methods :wifiName()
Class :MobileData
Methods :dataName()
Class :Lan
Methods :lanName()
Class :Wireless
Methods :modamName()
Description:
Create an object for all 4 classes inside the Wifi class and call all classes
methods also follow the all coding standards.
ANSWER:
package org.network;
---------------------------------------------------
package org.network;
---------------------------------------------
package org.network;
-------------------------------------------
package org.network;
----------------------------------------------
//Create an object for all 4 classes inside the Wifi class and
//call all classes methods also follow the all coding standards.
package org.network;