Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
Assignments
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Suresh Kumar
Assignments
Commits
1c494fc7
Commit
1c494fc7
authored
May 23, 2022
by
Suresh Kumar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Lang-Package
parent
d821306a
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
84 additions
and
0 deletions
+84
-0
CapitalizeEachWord.class
...ion/Lang-Package/langpackage/com/CapitalizeEachWord.class
+0
-0
CompareTwo.class
.../production/Lang-Package/langpackage/com/CompareTwo.class
+0
-0
Concat.class
.../out/production/Lang-Package/langpackage/com/Concat.class
+0
-0
Difference.class
.../production/Lang-Package/langpackage/com/Difference.class
+0
-0
CapitalizeEachWord.java
Lang-Package/src/langpackage/com/CapitalizeEachWord.java
+32
-0
CompareTwo.java
Lang-Package/src/langpackage/com/CompareTwo.java
+10
-0
Concat.java
Lang-Package/src/langpackage/com/Concat.java
+20
-0
Difference.java
Lang-Package/src/langpackage/com/Difference.java
+22
-0
No files found.
Lang-Package/out/production/Lang-Package/langpackage/com/CapitalizeEachWord.class
0 → 100644
View file @
1c494fc7
File added
Lang-Package/out/production/Lang-Package/langpackage/com/CompareTwo.class
0 → 100644
View file @
1c494fc7
File added
Lang-Package/out/production/Lang-Package/langpackage/com/Concat.class
0 → 100644
View file @
1c494fc7
File added
Lang-Package/out/production/Lang-Package/langpackage/com/Difference.class
0 → 100644
View file @
1c494fc7
File added
Lang-Package/src/langpackage/com/CapitalizeEachWord.java
0 → 100644
View file @
1c494fc7
package
langpackage
.
com
;
import
java.util.Scanner
;
public
class
CapitalizeEachWord
{
public
static
void
main
(
String
[]
args
){
Scanner
in
=
new
Scanner
(
System
.
in
);
System
.
out
.
print
(
"\nWrite a sentence here ------ "
);
String
str
=
in
.
nextLine
();
str
=
" "
+
str
;
String
fs
=
""
;
for
(
int
i
=
0
;
i
<
str
.
length
()-
1
;
i
++){
char
ch
=
str
.
charAt
(
i
);
if
(
ch
==
' '
){
fs
=
fs
+
ch
;
i
++;
ch
=
str
.
charAt
(
i
);
fs
=
fs
+
Character
.
toUpperCase
(
ch
);
}
else
{
fs
=
fs
+
ch
;
}
}
System
.
out
.
println
(
fs
);
System
.
out
.
println
(
"...................Assignment is Capitalize Each Word In Sentence................."
);
}
}
Lang-Package/src/langpackage/com/CompareTwo.java
0 → 100644
View file @
1c494fc7
package
langpackage
.
com
;
public
class
CompareTwo
{
public
static
void
main
(
String
[]
args
){
System
.
out
.
println
(
"\n--------------Comparing Two String Using Compareto() Method)------------\n"
);
String
name1
=
"Mr Suresh Kumar"
;
String
name2
=
"Mr Kumar Suresh"
;
System
.
out
.
println
(
"Output Of Two Strings using compareTo() Method .......................( "
+
name1
.
compareTo
(
name2
)
+
" ).\n"
);
}
}
Lang-Package/src/langpackage/com/Concat.java
0 → 100644
View file @
1c494fc7
package
langpackage
.
com
;
import
java.lang.*
;
public
class
Concat
{
public
static
void
main
(
String
[]
args
){
long
startTime
=
System
.
nanoTime
();
StringBuffer
stringBuffer
=
new
StringBuffer
(
" Nisum "
);
for
(
int
i
=
1
;
i
<=
10
;
i
++){
stringBuffer
.
append
(
"Technology"
);
}
System
.
out
.
println
(
"Performance Of StringBuffer ia---------( "
+
(
System
.
nanoTime
()-
startTime
)
+
" - nt )"
);
startTime
=
System
.
nanoTime
();
StringBuilder
stringBuilder
=
new
StringBuilder
(
"Nisum"
);
for
(
int
i
=
1
;
i
<=
10
;
i
++){
stringBuilder
.
append
(
"Technology"
);
}
System
.
out
.
println
(
"Performance of StringBuilder is ------- ( "
+
(
System
.
nanoTime
()-
startTime
)
+
" - nt )"
);
}
}
Lang-Package/src/langpackage/com/Difference.java
0 → 100644
View file @
1c494fc7
package
langpackage
.
com
;
public
class
Difference
{
public
static
void
main
(
String
[]
args
){
String
s1
=
new
String
(
"Suresh Kumar"
);
String
s2
=
new
String
(
"Suresh Kumar"
);
System
.
out
.
println
(
"------------------Comparing Two String Objects-------------------"
);
System
.
out
.
println
(
"Comparing Two String Objects With .Equals() Method Result is ----- "
+
s1
.
equals
(
s2
));
System
.
out
.
print
(
"Comparing Two String Objects With == Equal Operator Result is -----------"
);
System
.
out
.
println
(
s1
==
s2
);
System
.
out
.
println
(
"\n--------------------Comparing Two String Literals---------------------"
);
String
s3
=
"Muhammad Asad"
;
String
s4
=
"Muhammad Asad"
;
System
.
out
.
println
(
"Comparing two literal Strings With .eqauls Method Result is ----------"
+
s3
.
equals
(
s4
));
System
.
out
.
print
(
"Comparing two literal String with == Equal Operator Result is ------------ "
);
System
.
out
.
println
(
s3
==
s4
);
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment