Program to print following series: Code: import java.util.*; import java.io.*; class Test{ public static void main(St...
Read More
Showing posts with label Java Practical. Show all posts
Showing posts with label Java Practical. Show all posts
System.out.printf() in Java
Code: import java.util.Scanner; public class Test { public static void main(String[] args) { Scanner sc=new Scanner(...
Read More
How to get day from specific date in Java
Code: import java.util.*; import java.text.*; import java.time.LocalDate; class Test{ public static void main(String []argh) thr...
Read More
Check IP Address Pattern using regex match in Java
Code: import java.util.Scanner; import java.util.regex.Matcher; import java.util.regex.Pattern; public class Test { public sta...
Read More
4 Set up a Java Programming development environment by using (a) command Prompt, set the PATH environment variable, write the steps for all of these and run a simple java program to display string hello world to test setup is correct.
Setting up Java Environment Using Command Prompt: Setting up Java Environment Using Environmental Variable: Steps to Run Java P...
Read More
3 Write the java Program to demonstrate the use of If else-if ladder. And display student grading as fail, D grade, C grade, B grade, A grade and A+.
Code: public class IfElseIfExample { public static void main(String[] args) { int marks=65; if(marks<50) { System...
Read More
2 Write the program to demonstrate the use of method that take variable length arguments using Var-args function in Java.
Code: class VarargExample { public int sumNumber(int ... args) { System.out.println("argument length: " + args.length)...
Read More
1 Write the program to demonstrate the use of for-each version of for loop in Java.
Code: public class Test { public static void main(String args[]) { int [] numbers = {10, 20, 30, 40, 50}; for(int x : num...
Read More
Can we able to compile and execute Java Program without Class?
Can we compile and execute without class? yes jdk 1.5 : enum; jdk 1.8 : interface; Code: Using Enum enum Test { ; p...
Read More
Practical No. 14: Develop program for implementation of Vectors in Java
1) Write a program to insert different elements in the Vector and display them. 2) State the output import java.util.*; class demo1 {...
Read More
Practical No. 13: Develop program for implementation of Arrays in Java
1) Write a program to implement multidimensional array. Click Here 2) State line number and error. class Test2 { public static void ...
Read More
Practical No. 11 and 12: Develop program for implementation of different functions of String class
1) Write a program to show the use of all methods of String Class. Click Here 2) State Output class String_demo { public static vo...
Read More
Practical No. 10: Develop program for implementation of constructor and multiple constructor
1) Demonstrate use of at least two types of constructors. Code: class Const { int a,b; Const(int a,int b) { this.a=a; th...
Read More
Practical No. 4: Develop programs to demonstrate use of switch - case statement and conditional if (?:)
1) Write any program using switch-case statement For Program Click here Practical Related Questions 1) What will happen if bre...
Read More
Practical No 3: Develop program to demonstrate use of if statements and its different forms.
Write any Program to check multiple conditions using if statement. Logic.java class Logic { public static void main( String args[] ...
Read More
Practical No 1 and 2: Setup a Java Programming Development environment and test using small program.
1) Write installation directory path of your directory? Ans=> C:\Program Files\Java\jdk-10.0.2 2) Write value of path environment va...
Read More
Subscribe to:
Posts (Atom)